summaryrefslogtreecommitdiffstats
path: root/Source/cmIfCommand.cxx
diff options
context:
space:
mode:
authorRegina Pfeifer <regina@mailbox.org>2019-04-07 19:46:46 (GMT)
committerRegina Pfeifer <regina@mailbox.org>2019-07-21 07:25:32 (GMT)
commit28f2d12a055e025aa0ddeb9842f204f29181eaff (patch)
treec72caeac0330934a280f3a014688b43c55a11eea /Source/cmIfCommand.cxx
parentde77d355ac1808164b7247290f45b8133ce1246b (diff)
downloadCMake-28f2d12a055e025aa0ddeb9842f204f29181eaff.zip
CMake-28f2d12a055e025aa0ddeb9842f204f29181eaff.tar.gz
CMake-28f2d12a055e025aa0ddeb9842f204f29181eaff.tar.bz2
cmCommand: De-virtualize function InvokeInitialPass
Diffstat (limited to 'Source/cmIfCommand.cxx')
-rw-r--r--Source/cmIfCommand.cxx17
1 files changed, 9 insertions, 8 deletions
diff --git a/Source/cmIfCommand.cxx b/Source/cmIfCommand.cxx
index 4edea17..385022c 100644
--- a/Source/cmIfCommand.cxx
+++ b/Source/cmIfCommand.cxx
@@ -13,6 +13,7 @@
#include "cmSystemTools.h"
#include "cmake.h"
+#include <string>
#include <utility>
static std::string cmIfCommandError(
@@ -176,19 +177,19 @@ bool cmIfFunctionBlocker::ShouldRemove(const cmListFileFunction& lff,
}
//=========================================================================
-bool cmIfCommand::InvokeInitialPass(
- const std::vector<cmListFileArgument>& args, cmExecutionStatus&)
+bool cmIfCommand(std::vector<cmListFileArgument> const& args,
+ cmExecutionStatus& inStatus)
{
+ cmMakefile& makefile = inStatus.GetMakefile();
std::string errorString;
std::vector<cmExpandedCommandArgument> expandedArguments;
- this->Makefile->ExpandArguments(args, expandedArguments);
+ makefile.ExpandArguments(args, expandedArguments);
MessageType status;
cmConditionEvaluator conditionEvaluator(
- *(this->Makefile), this->Makefile->GetExecutionContext(),
- this->Makefile->GetBacktrace());
+ makefile, makefile.GetExecutionContext(), makefile.GetBacktrace());
bool isTrue =
conditionEvaluator.IsTrue(expandedArguments, errorString, status);
@@ -197,11 +198,11 @@ bool cmIfCommand::InvokeInitialPass(
std::string err = "if " + cmIfCommandError(expandedArguments);
err += errorString;
if (status == MessageType::FATAL_ERROR) {
- this->Makefile->IssueMessage(MessageType::FATAL_ERROR, err);
+ makefile.IssueMessage(MessageType::FATAL_ERROR, err);
cmSystemTools::SetFatalErrorOccured();
return true;
}
- this->Makefile->IssueMessage(status, err);
+ makefile.IssueMessage(status, err);
}
{
@@ -213,7 +214,7 @@ bool cmIfCommand::InvokeInitialPass(
fb->HasRun = true;
}
fb->Args = args;
- this->Makefile->AddFunctionBlocker(std::move(fb));
+ makefile.AddFunctionBlocker(std::move(fb));
}
return true;