diff --git a/Source/cmConditionEvaluator.cxx b/Source/cmConditionEvaluator.cxx index 7ada8d831e..14f10bd747 100644 --- a/Source/cmConditionEvaluator.cxx +++ b/Source/cmConditionEvaluator.cxx @@ -56,10 +56,8 @@ static std::string const keyVERSION_LESS = "VERSION_LESS"; static std::string const keyVERSION_LESS_EQUAL = "VERSION_LESS_EQUAL"; cmConditionEvaluator::cmConditionEvaluator(cmMakefile& makefile, - cmListFileContext context, cmListFileBacktrace bt) : Makefile(makefile) - , ExecutionContext(std::move(context)) , Backtrace(std::move(bt)) , Policy12Status(makefile.GetPolicyStatus(cmPolicies::CMP0012)) , Policy54Status(makefile.GetPolicyStatus(cmPolicies::CMP0054)) @@ -147,8 +145,7 @@ cmProp cmConditionEvaluator::GetDefinitionIfUnquoted( if (def && argument.WasQuoted() && this->Policy54Status == cmPolicies::WARN) { - if (!this->Makefile.HasCMP0054AlreadyBeenReported( - this->ExecutionContext)) { + if (!this->Makefile.HasCMP0054AlreadyBeenReported(this->Backtrace.Top())) { std::ostringstream e; e << (cmPolicies::GetPolicyWarning(cmPolicies::CMP0054)) << "\n"; e << "Quoted variables like \"" << argument.GetValue() @@ -191,8 +188,7 @@ bool cmConditionEvaluator::IsKeyword(std::string const& keyword, if (isKeyword && argument.WasQuoted() && this->Policy54Status == cmPolicies::WARN) { - if (!this->Makefile.HasCMP0054AlreadyBeenReported( - this->ExecutionContext)) { + if (!this->Makefile.HasCMP0054AlreadyBeenReported(this->Backtrace.Top())) { std::ostringstream e; e << cmPolicies::GetPolicyWarning(cmPolicies::CMP0054) << "\n"; e << "Quoted keywords like \"" << argument.GetValue() diff --git a/Source/cmConditionEvaluator.h b/Source/cmConditionEvaluator.h index a4cedffcc1..cf00ede35c 100644 --- a/Source/cmConditionEvaluator.h +++ b/Source/cmConditionEvaluator.h @@ -21,8 +21,7 @@ class cmConditionEvaluator public: using cmArgumentList = std::list; - cmConditionEvaluator(cmMakefile& makefile, cmListFileContext context, - cmListFileBacktrace bt); + cmConditionEvaluator(cmMakefile& makefile, cmListFileBacktrace bt); // this is a shared function for both If and Else to determine if the // arguments were valid, and if so, was the response true. If there is @@ -79,7 +78,6 @@ private: MessageType& status); cmMakefile& Makefile; - cmListFileContext ExecutionContext; cmListFileBacktrace Backtrace; cmPolicies::PolicyStatus Policy12Status; cmPolicies::PolicyStatus Policy54Status; diff --git a/Source/cmIfCommand.cxx b/Source/cmIfCommand.cxx index 557817ce44..fc257b15a9 100644 --- a/Source/cmIfCommand.cxx +++ b/Source/cmIfCommand.cxx @@ -120,12 +120,7 @@ bool cmIfFunctionBlocker::Replay(std::vector functions, MessageType messType; - cmListFileContext conditionContext = - cmListFileContext::FromCommandContext( - func, this->GetStartingContext().FilePath); - - cmConditionEvaluator conditionEvaluator(mf, conditionContext, - elseifBT); + cmConditionEvaluator conditionEvaluator(mf, elseifBT); bool isTrue = conditionEvaluator.IsTrue(expandedArguments, errorString, messType); @@ -180,8 +175,7 @@ bool cmIfCommand(std::vector const& args, MessageType status; - cmConditionEvaluator conditionEvaluator( - makefile, makefile.GetBacktrace().Top(), makefile.GetBacktrace()); + cmConditionEvaluator conditionEvaluator(makefile, makefile.GetBacktrace()); bool isTrue = conditionEvaluator.IsTrue(expandedArguments, errorString, status); diff --git a/Source/cmWhileCommand.cxx b/Source/cmWhileCommand.cxx index 876ce20bcf..2c7a8a7883 100644 --- a/Source/cmWhileCommand.cxx +++ b/Source/cmWhileCommand.cxx @@ -69,8 +69,7 @@ bool cmWhileFunctionBlocker::Replay(std::vector functions, cmListFileBacktrace whileBT = mf.GetBacktrace().Push(this->GetStartingContext()); - cmConditionEvaluator conditionEvaluator(mf, this->GetStartingContext(), - whileBT); + cmConditionEvaluator conditionEvaluator(mf, whileBT); bool isTrue = conditionEvaluator.IsTrue(expandedArguments, errorString, messageType);