diff options
author | Brad King <brad.king@kitware.com> | 2016-04-18 15:07:07 (GMT) |
---|---|---|
committer | CMake Topic Stage <kwrobot@kitware.com> | 2016-04-18 15:07:07 (GMT) |
commit | fa4ae9fb12b61473f028a3ec38433f82a030c578 (patch) | |
tree | 5a66cf099293e3e859b99bd3efeb3b3054a34efc /Source/cmState.cxx | |
parent | ef713503c8b9b317fdbd21c75d332febd77c31a3 (diff) | |
parent | 0f96ef00cbe8dd82cee32f61f9da43e66e42f446 (diff) | |
download | CMake-fa4ae9fb12b61473f028a3ec38433f82a030c578.zip CMake-fa4ae9fb12b61473f028a3ec38433f82a030c578.tar.gz CMake-fa4ae9fb12b61473f028a3ec38433f82a030c578.tar.bz2 |
Merge topic 'refactor-cmListFileBacktrace'
0f96ef00 Remove unused cmake::IssueMessage overload
563bf9dd cmState: Remove unused entry point fields from snapshot data
7c36d206 cmListFileBacktrace: Refactor storage to provide efficient value semantics
1f6bd8a9 cmState: Avoid accumulating snapshot storage for backtraces
18b6676b cmState: Add Snapshot method to get bottom of call stack
Diffstat (limited to 'Source/cmState.cxx')
-rw-r--r-- | Source/cmState.cxx | 60 |
1 files changed, 17 insertions, 43 deletions
diff --git a/Source/cmState.cxx b/Source/cmState.cxx index 7670c10..f5d6378 100644 --- a/Source/cmState.cxx +++ b/Source/cmState.cxx @@ -35,8 +35,6 @@ struct cmState::SnapshotDataType cmLinkedTree<cmDefinitions>::iterator Vars; cmLinkedTree<cmDefinitions>::iterator Root; cmLinkedTree<cmDefinitions>::iterator Parent; - std::string EntryPointCommand; - long EntryPointLine; std::vector<std::string>::size_type IncludeDirectoryPosition; std::vector<std::string>::size_type CompileDefinitionsPosition; std::vector<std::string>::size_type CompileOptionsPosition; @@ -845,14 +843,10 @@ cmState::Snapshot cmState::CreateBaseSnapshot() } cmState::Snapshot -cmState::CreateBuildsystemDirectorySnapshot(Snapshot originSnapshot, - std::string const& entryPointCommand, - long entryPointLine) +cmState::CreateBuildsystemDirectorySnapshot(Snapshot originSnapshot) { assert(originSnapshot.IsValid()); PositionType pos = this->SnapshotData.Push(originSnapshot.Position); - pos->EntryPointLine = entryPointLine; - pos->EntryPointCommand = entryPointCommand; pos->DirectoryParent = originSnapshot.Position; pos->ScopeParent = originSnapshot.Position; pos->SnapshotType = BuildsystemDirectoryType; @@ -886,15 +880,11 @@ cmState::CreateBuildsystemDirectorySnapshot(Snapshot originSnapshot, cmState::Snapshot cmState::CreateFunctionCallSnapshot(cmState::Snapshot originSnapshot, - std::string const& entryPointCommand, - long entryPointLine, std::string const& fileName) { PositionType pos = this->SnapshotData.Push(originSnapshot.Position, *originSnapshot.Position); pos->ScopeParent = originSnapshot.Position; - pos->EntryPointLine = entryPointLine; - pos->EntryPointCommand = entryPointCommand; pos->SnapshotType = FunctionCallType; pos->Keep = false; pos->ExecutionListFile = this->ExecutionListFiles.Push( @@ -912,14 +902,10 @@ cmState::CreateFunctionCallSnapshot(cmState::Snapshot originSnapshot, cmState::Snapshot cmState::CreateMacroCallSnapshot(cmState::Snapshot originSnapshot, - std::string const& entryPointCommand, - long entryPointLine, std::string const& fileName) { PositionType pos = this->SnapshotData.Push(originSnapshot.Position, *originSnapshot.Position); - pos->EntryPointLine = entryPointLine; - pos->EntryPointCommand = entryPointCommand; pos->SnapshotType = MacroCallType; pos->Keep = false; pos->ExecutionListFile = this->ExecutionListFiles.Push( @@ -932,14 +918,10 @@ cmState::CreateMacroCallSnapshot(cmState::Snapshot originSnapshot, cmState::Snapshot cmState::CreateIncludeFileSnapshot(cmState::Snapshot originSnapshot, - const std::string& entryPointCommand, - long entryPointLine, const std::string& fileName) { PositionType pos = this->SnapshotData.Push(originSnapshot.Position, *originSnapshot.Position); - pos->EntryPointLine = entryPointLine; - pos->EntryPointCommand = entryPointCommand; pos->SnapshotType = IncludeFileType; pos->Keep = true; pos->ExecutionListFile = this->ExecutionListFiles.Push( @@ -951,15 +933,11 @@ cmState::CreateIncludeFileSnapshot(cmState::Snapshot originSnapshot, } cmState::Snapshot -cmState::CreateVariableScopeSnapshot(cmState::Snapshot originSnapshot, - std::string const& entryPointCommand, - long entryPointLine) +cmState::CreateVariableScopeSnapshot(cmState::Snapshot originSnapshot) { PositionType pos = this->SnapshotData.Push(originSnapshot.Position, *originSnapshot.Position); pos->ScopeParent = originSnapshot.Position; - pos->EntryPointLine = entryPointLine; - pos->EntryPointCommand = entryPointCommand; pos->SnapshotType = VariableScopeType; pos->Keep = false; pos->PolicyScope = originSnapshot.Position->Policies; @@ -975,14 +953,10 @@ cmState::CreateVariableScopeSnapshot(cmState::Snapshot originSnapshot, cmState::Snapshot cmState::CreateInlineListFileSnapshot(cmState::Snapshot originSnapshot, - const std::string& entryPointCommand, - long entryPointLine, const std::string& fileName) { PositionType pos = this->SnapshotData.Push(originSnapshot.Position, *originSnapshot.Position); - pos->EntryPointLine = entryPointLine; - pos->EntryPointCommand = entryPointCommand; pos->SnapshotType = InlineListFileType; pos->Keep = true; pos->ExecutionListFile = this->ExecutionListFiles.Push( @@ -1098,11 +1072,6 @@ void cmState::Directory::SetCurrentBinary(std::string const& dir) this->Snapshot_.SetDefinition("CMAKE_CURRENT_BINARY_DIR", loc.c_str()); } -void cmState::Snapshot::Keep() -{ - this->Position->Keep = true; -} - void cmState::Snapshot::SetListFile(const std::string& listfile) { *this->Position->ExecutionListFile = listfile; @@ -1145,16 +1114,6 @@ std::string cmState::Snapshot::GetExecutionListFile() const return *this->Position->ExecutionListFile; } -std::string cmState::Snapshot::GetEntryPointCommand() const -{ - return this->Position->EntryPointCommand; -} - -long cmState::Snapshot::GetEntryPointLine() const -{ - return this->Position->EntryPointLine; -} - bool cmState::Snapshot::IsValid() const { return this->State && this->Position.IsValid() @@ -1213,6 +1172,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; |