From ae026f5458c5c919031a41310321ae26cd56fae0 Mon Sep 17 00:00:00 2001 From: Stephen Kelly Date: Sun, 19 Jul 2015 16:26:49 +0200 Subject: [PATCH] cmState: Store Children states in parent state. --- Source/cmState.cxx | 12 +++++++++++- Source/cmState.h | 2 ++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/Source/cmState.cxx b/Source/cmState.cxx index 53fdae0d67..3df855a8a5 100644 --- a/Source/cmState.cxx +++ b/Source/cmState.cxx @@ -76,6 +76,8 @@ struct cmState::BuildsystemDirectoryStateType std::vector CompileOptionsBacktraces; cmPropertyMap Properties; + + std::vector Children; }; cmState::cmState(cmake* cm) @@ -274,6 +276,7 @@ cmState::Snapshot cmState::Reset() it->CompileOptionsBacktraces.clear(); it->DirectoryEnd = pos; it->Properties.clear(); + it->Children.clear(); } this->PolicyStack.Clear(); @@ -800,7 +803,9 @@ cmState::CreateBuildsystemDirectorySnapshot(Snapshot originSnapshot, pos->Parent = origin; pos->Root = origin; pos->Vars = this->VarTree.Extend(origin); - return cmState::Snapshot(this, pos); + cmState::Snapshot snapshot = cmState::Snapshot(this, pos); + originSnapshot.Position->BuildSystemDirectory->Children.push_back(snapshot); + return snapshot; } cmState::Snapshot @@ -938,6 +943,11 @@ cmState::Snapshot::Snapshot(cmState* state) { } +std::vector cmState::Snapshot::GetChildren() +{ + return this->Position->BuildSystemDirectory->Children; +} + cmState::Snapshot::Snapshot(cmState* state, PositionType position) : State(state), Position(position) diff --git a/Source/cmState.h b/Source/cmState.h index e503cd2588..a488c62686 100644 --- a/Source/cmState.h +++ b/Source/cmState.h @@ -65,6 +65,8 @@ public: void SetListFile(std::string const& listfile); std::string GetExecutionListFile() const; + + std::vector GetChildren(); std::string GetEntryPointCommand() const; long GetEntryPointLine() const;