summaryrefslogtreecommitdiffstats
path: root/Source/cmState.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2016-04-13 13:41:24 (GMT)
committerBrad King <brad.king@kitware.com>2016-04-15 14:31:39 (GMT)
commit18b6676bff6d50ebc38c75e7998298fca75a01c5 (patch)
treea5edb73f6e14285c99c74ae2ae1681b96447c1ba /Source/cmState.cxx
parent2faa8b362050c716cc5626f9bb9d8a8612b97f95 (diff)
downloadCMake-18b6676bff6d50ebc38c75e7998298fca75a01c5.zip
CMake-18b6676bff6d50ebc38c75e7998298fca75a01c5.tar.gz
CMake-18b6676bff6d50ebc38c75e7998298fca75a01c5.tar.bz2
cmState: Add Snapshot method to get bottom of call stack
The bottom of the call stack is always a long-lived snapshot and can be saved for later use with cmOutputConverter.
Diffstat (limited to 'Source/cmState.cxx')
-rw-r--r--Source/cmState.cxx15
1 files changed, 15 insertions, 0 deletions
diff --git a/Source/cmState.cxx b/Source/cmState.cxx
index be8e418..c48f9b1 100644
--- a/Source/cmState.cxx
+++ b/Source/cmState.cxx
@@ -1213,6 +1213,21 @@ cmState::Snapshot cmState::Snapshot::GetCallStackParent() const
return snapshot;
}
+cmState::Snapshot cmState::Snapshot::GetCallStackBottom() const
+{
+ assert(this->State);
+ assert(this->Position != this->State->SnapshotData.Root());
+
+ PositionType pos = this->Position;
+ while (pos->SnapshotType != cmState::BaseType &&
+ pos->SnapshotType != cmState::BuildsystemDirectoryType &&
+ pos != this->State->SnapshotData.Root())
+ {
+ ++pos;
+ }
+ return Snapshot(this->State, pos);
+}
+
void cmState::Snapshot::PushPolicy(cmPolicies::PolicyMap entry, bool weak)
{
PositionType pos = this->Position;