diff options
author | Stephen Kelly <steveire@gmail.com> | 2015-07-26 10:56:10 (GMT) |
---|---|---|
committer | Stephen Kelly <steveire@gmail.com> | 2015-08-02 06:56:57 (GMT) |
commit | 348354333a82ce98d733dc2ee939186c53c506f9 (patch) | |
tree | 6cccb581d9ce5af3498dab650a30348ad0cad9a6 /Source/cmState.cxx | |
parent | af0de01c6b3395fb1dba5d2ee0a94c19a9b464e9 (diff) | |
download | CMake-348354333a82ce98d733dc2ee939186c53c506f9.zip CMake-348354333a82ce98d733dc2ee939186c53c506f9.tar.gz CMake-348354333a82ce98d733dc2ee939186c53c506f9.tar.bz2 |
cmState: Add Type for policy scope.
Diffstat (limited to 'Source/cmState.cxx')
-rw-r--r-- | Source/cmState.cxx | 22 |
1 files changed, 20 insertions, 2 deletions
diff --git a/Source/cmState.cxx b/Source/cmState.cxx index a7df040..09446bb 100644 --- a/Source/cmState.cxx +++ b/Source/cmState.cxx @@ -809,6 +809,15 @@ cmState::CreateInlineListFileSnapshot(cmState::Snapshot originSnapshot, return cmState::Snapshot(this, pos); } +cmState::Snapshot +cmState::CreatePolicyScopeSnapshot(cmState::Snapshot originSnapshot) +{ + PositionType pos = this->SnapshotData.Extend(originSnapshot.Position, + *originSnapshot.Position); + pos->SnapshotType = PolicyScopeType; + return cmState::Snapshot(this, pos); +} + cmState::Snapshot cmState::Pop(cmState::Snapshot originSnapshot) { PositionType pos = originSnapshot.Position; @@ -959,13 +968,22 @@ cmState::Snapshot cmState::Snapshot::GetCallStackParent() const assert(this->Position != this->State->SnapshotData.Root()); Snapshot snapshot; - if (this->Position->SnapshotType == cmState::BuildsystemDirectoryType) + PositionType parentPos = this->Position; + while(parentPos->SnapshotType == cmState::PolicyScopeType) + { + ++parentPos; + } + if (parentPos->SnapshotType == cmState::BuildsystemDirectoryType) { return snapshot; } - PositionType parentPos = this->Position; ++parentPos; + while(parentPos->SnapshotType == cmState::PolicyScopeType) + { + ++parentPos; + } + if (parentPos == this->State->SnapshotData.Root()) { return snapshot; |