diff options
author | Stephen Kelly <steveire@gmail.com> | 2015-06-21 19:26:36 (GMT) |
---|---|---|
committer | Stephen Kelly <steveire@gmail.com> | 2015-07-04 09:51:27 (GMT) |
commit | a8e54460243b0650145c8684f3d8deb8a712376a (patch) | |
tree | 15c98b9a00b629302430c82b477c0f859bfa8658 /Source/cmState.cxx | |
parent | dbafb01580a0d35e33e6577ad07002f4dd345236 (diff) | |
download | CMake-a8e54460243b0650145c8684f3d8deb8a712376a.zip CMake-a8e54460243b0650145c8684f3d8deb8a712376a.tar.gz CMake-a8e54460243b0650145c8684f3d8deb8a712376a.tar.bz2 |
cmState: Store snapshots for more different types.
Adjust cmMakefile implementation to create the snapshots.
Diffstat (limited to 'Source/cmState.cxx')
-rw-r--r-- | Source/cmState.cxx | 55 |
1 files changed, 55 insertions, 0 deletions
diff --git a/Source/cmState.cxx b/Source/cmState.cxx index 58500cc..ef55e09 100644 --- a/Source/cmState.cxx +++ b/Source/cmState.cxx @@ -20,6 +20,7 @@ struct cmState::SnapshotDataType { + cmState::PositionType CallStackParent; cmState::PositionType DirectoryParent; cmState::SnapshotType SnapshotType; cmLinkedTree<cmState::BuildsystemDirectoryStateType>::iterator @@ -690,6 +691,7 @@ cmState::CreateBuildsystemDirectorySnapshot(Snapshot originSnapshot) { assert(originSnapshot.IsValid()); PositionType pos = this->SnapshotData.Extend(originSnapshot.Position); + pos->CallStackParent = originSnapshot.Position; pos->DirectoryParent = originSnapshot.Position; pos->SnapshotType = BuildsystemDirectoryType; pos->BuildSystemDirectory = @@ -698,6 +700,59 @@ cmState::CreateBuildsystemDirectorySnapshot(Snapshot originSnapshot) return cmState::Snapshot(this, pos); } +cmState::Snapshot +cmState::CreateFunctionCallSnapshot(cmState::Snapshot originSnapshot) +{ + PositionType pos = this->SnapshotData.Extend(originSnapshot.Position, + *originSnapshot.Position); + pos->CallStackParent = originSnapshot.Position; + pos->SnapshotType = FunctionCallType; + return cmState::Snapshot(this, pos); +} + + +cmState::Snapshot +cmState::CreateMacroCallSnapshot(cmState::Snapshot originSnapshot) +{ + PositionType pos = this->SnapshotData.Extend(originSnapshot.Position, + *originSnapshot.Position); + pos->CallStackParent = originSnapshot.Position; + pos->SnapshotType = MacroCallType; + return cmState::Snapshot(this, pos); +} + +cmState::Snapshot +cmState::CreateCallStackSnapshot(cmState::Snapshot originSnapshot) +{ + PositionType pos = this->SnapshotData.Extend(originSnapshot.Position, + *originSnapshot.Position); + pos->CallStackParent = originSnapshot.Position; + pos->SnapshotType = CallStackType; + return cmState::Snapshot(this, pos); +} + +cmState::Snapshot +cmState::CreateInlineListFileSnapshot(cmState::Snapshot originSnapshot) +{ + PositionType pos = this->SnapshotData.Extend(originSnapshot.Position, + *originSnapshot.Position); + pos->CallStackParent = originSnapshot.Position; + pos->SnapshotType = InlineListFileType; + return cmState::Snapshot(this, pos); +} + +cmState::Snapshot cmState::Pop(cmState::Snapshot originSnapshot) +{ + PositionType pos = originSnapshot.Position; + PositionType prevPos = pos; + ++prevPos; + if (prevPos == this->SnapshotData.Root()) + { + return Snapshot(this, prevPos); + } + return Snapshot(this, originSnapshot.Position->CallStackParent); +} + cmState::Snapshot::Snapshot(cmState* state, PositionType position) : State(state), Position(position) |