summaryrefslogtreecommitdiffstats
path: root/Source/cmState.cxx
diff options
context:
space:
mode:
authorStephen Kelly <steveire@gmail.com>2015-07-26 10:56:10 (GMT)
committerStephen Kelly <steveire@gmail.com>2015-08-02 06:56:57 (GMT)
commit348354333a82ce98d733dc2ee939186c53c506f9 (patch)
tree6cccb581d9ce5af3498dab650a30348ad0cad9a6 /Source/cmState.cxx
parentaf0de01c6b3395fb1dba5d2ee0a94c19a9b464e9 (diff)
downloadCMake-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.cxx22
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;