From 28749903b67d71b35f6ff74dab7c6db1a648a1c8 Mon Sep 17 00:00:00 2001 From: Stephen Kelly Date: Tue, 6 Oct 2015 00:33:49 +0200 Subject: [PATCH] cmState: Internalize the initialization of a snapshot from its parent. --- Source/cmMakefile.cxx | 2 -- Source/cmState.cxx | 2 ++ Source/cmState.h | 5 +++-- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx index 2c9dfbb1a..c06050557 100644 --- a/Source/cmMakefile.cxx +++ b/Source/cmMakefile.cxx @@ -1761,8 +1761,6 @@ void cmMakefile::AddSubDirectory(const std::string& srcPath, this->ContextStack.back()->Name, this->ContextStack.back()->Line); - newSnapshot.InitializeFromParent(); - newSnapshot.GetDirectory().SetCurrentSource(srcPath); newSnapshot.GetDirectory().SetCurrentBinary(binPath); diff --git a/Source/cmState.cxx b/Source/cmState.cxx index ce9ff323b..db7519b89 100644 --- a/Source/cmState.cxx +++ b/Source/cmState.cxx @@ -805,8 +805,10 @@ cmState::CreateBuildsystemDirectorySnapshot(Snapshot originSnapshot, pos->Parent = origin; pos->Root = origin; pos->Vars = this->VarTree.Extend(origin); + cmState::Snapshot snapshot = cmState::Snapshot(this, pos); originSnapshot.Position->BuildSystemDirectory->Children.push_back(snapshot); + snapshot.InitializeFromParent(); return snapshot; } diff --git a/Source/cmState.h b/Source/cmState.h index 99e537c07..1ffc4bf44 100644 --- a/Source/cmState.h +++ b/Source/cmState.h @@ -75,8 +75,6 @@ public: Snapshot GetCallStackParent() const; SnapshotType GetType() const; - void InitializeFromParent(); - void SetPolicy(cmPolicies::PolicyID id, cmPolicies::PolicyStatus status); cmPolicies::PolicyStatus GetPolicy(cmPolicies::PolicyID id) const; bool HasDefinedPolicyCMP0011(); @@ -105,6 +103,9 @@ public: friend class cmState; friend class Directory; friend struct StrictWeakOrder; + + void InitializeFromParent(); + cmState* State; cmState::PositionType Position; };