summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Source/cmState.cxx15
-rw-r--r--Source/cmState.h1
2 files changed, 16 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;
diff --git a/Source/cmState.h b/Source/cmState.h
index ef61406..0cce644 100644
--- a/Source/cmState.h
+++ b/Source/cmState.h
@@ -75,6 +75,7 @@ public:
bool IsValid() const;
Snapshot GetBuildsystemDirectoryParent() const;
Snapshot GetCallStackParent() const;
+ Snapshot GetCallStackBottom() const;
SnapshotType GetType() const;
void SetPolicy(cmPolicies::PolicyID id, cmPolicies::PolicyStatus status);