diff options
author | Brad King <brad.king@kitware.com> | 2016-04-13 13:41:24 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2016-04-15 14:31:39 (GMT) |
commit | 18b6676bff6d50ebc38c75e7998298fca75a01c5 (patch) | |
tree | a5edb73f6e14285c99c74ae2ae1681b96447c1ba /Source/cmState.cxx | |
parent | 2faa8b362050c716cc5626f9bb9d8a8612b97f95 (diff) | |
download | CMake-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.cxx | 15 |
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; |