diff options
author | Brad King <brad.king@kitware.com> | 2020-09-25 11:40:42 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2020-09-28 13:49:07 (GMT) |
commit | 68af831505450a34ddd4bf767844bc3890eb52e5 (patch) | |
tree | 30acd56959f1bc4b36e9b69451264fc67ac73cf4 | |
parent | 280f3918f3a731f64c94b2b7c912c58d714fc676 (diff) | |
download | CMake-68af831505450a34ddd4bf767844bc3890eb52e5.zip CMake-68af831505450a34ddd4bf767844bc3890eb52e5.tar.gz CMake-68af831505450a34ddd4bf767844bc3890eb52e5.tar.bz2 |
cmMakefile: Inline GetExecutionContext at call sites
The method only had one line, and its implementation is more clear
at the call sites than the method name.
-rw-r--r-- | Source/cmCMakeLanguageCommand.cxx | 2 | ||||
-rw-r--r-- | Source/cmIfCommand.cxx | 2 | ||||
-rw-r--r-- | Source/cmMakefile.cxx | 7 | ||||
-rw-r--r-- | Source/cmMakefile.h | 1 | ||||
-rw-r--r-- | Source/cmTargetLinkLibrariesCommand.cxx | 3 |
5 files changed, 5 insertions, 10 deletions
diff --git a/Source/cmCMakeLanguageCommand.cxx b/Source/cmCMakeLanguageCommand.cxx index eb9269f..d513611 100644 --- a/Source/cmCMakeLanguageCommand.cxx +++ b/Source/cmCMakeLanguageCommand.cxx @@ -39,7 +39,7 @@ bool cmCMakeLanguageCommand(std::vector<cmListFileArgument> const& args, } cmMakefile& makefile = status.GetMakefile(); - cmListFileContext context = makefile.GetExecutionContext(); + cmListFileContext context = makefile.GetBacktrace().Top(); bool result = false; diff --git a/Source/cmIfCommand.cxx b/Source/cmIfCommand.cxx index 5808f90..9930a85 100644 --- a/Source/cmIfCommand.cxx +++ b/Source/cmIfCommand.cxx @@ -179,7 +179,7 @@ bool cmIfCommand(std::vector<cmListFileArgument> const& args, MessageType status; cmConditionEvaluator conditionEvaluator( - makefile, makefile.GetExecutionContext(), makefile.GetBacktrace()); + makefile, makefile.GetBacktrace().Top(), makefile.GetBacktrace()); bool isTrue = conditionEvaluator.IsTrue(expandedArguments, errorString, status); diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx index 1c9aa52..3721056 100644 --- a/Source/cmMakefile.cxx +++ b/Source/cmMakefile.cxx @@ -283,11 +283,6 @@ cmListFileBacktrace cmMakefile::GetBacktrace(cmCommandContext const& cc) const return this->Backtrace.Push(lfc); } -cmListFileContext cmMakefile::GetExecutionContext() const -{ - return this->Backtrace.Top(); -} - void cmMakefile::PrintCommandTrace(const cmListFileFunction& lff) const { // Check if current file in the list of requested to trace... @@ -3419,7 +3414,7 @@ void cmMakefile::AddFunctionBlocker(std::unique_ptr<cmFunctionBlocker> fb) { if (!this->ExecutionStatusStack.empty()) { // Record the context in which the blocker is created. - fb->SetStartingContext(this->GetExecutionContext()); + fb->SetStartingContext(this->Backtrace.Top()); } this->FunctionBlockers.push(std::move(fb)); diff --git a/Source/cmMakefile.h b/Source/cmMakefile.h index 0a6e6e2..6236129 100644 --- a/Source/cmMakefile.h +++ b/Source/cmMakefile.h @@ -641,7 +641,6 @@ public: */ cmListFileBacktrace GetBacktrace() const; cmListFileBacktrace GetBacktrace(cmCommandContext const& lfc) const; - cmListFileContext GetExecutionContext() const; /** * Get the vector of files created by this makefile diff --git a/Source/cmTargetLinkLibrariesCommand.cxx b/Source/cmTargetLinkLibrariesCommand.cxx index 7db2c46..aecc18e 100644 --- a/Source/cmTargetLinkLibrariesCommand.cxx +++ b/Source/cmTargetLinkLibrariesCommand.cxx @@ -10,6 +10,7 @@ #include "cmExecutionStatus.h" #include "cmGeneratorExpression.h" #include "cmGlobalGenerator.h" +#include "cmListFileCache.h" #include "cmMakefile.h" #include "cmMessageType.h" #include "cmPolicies.h" @@ -386,7 +387,7 @@ bool TLL::HandleLibrary(ProcessingState currentProcessingState, ? cmTarget::KeywordTLLSignature : cmTarget::PlainTLLSignature; if (!this->Target->PushTLLCommandTrace( - sig, this->Makefile.GetExecutionContext())) { + sig, this->Makefile.GetBacktrace().Top())) { std::ostringstream e; const char* modal = nullptr; MessageType messageType = MessageType::AUTHOR_WARNING; |