Przeglądaj źródła

cmState: Internalize the initialization of a snapshot from its parent.

Stephen Kelly 10 lat temu
rodzic
commit
28749903b6
3 zmienionych plików z 5 dodań i 4 usunięć
  1. 0 2
      Source/cmMakefile.cxx
  2. 2 0
      Source/cmState.cxx
  3. 3 2
      Source/cmState.h

+ 0 - 2
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);
 

+ 2 - 0
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;
 }
 

+ 3 - 2
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;
   };