summaryrefslogtreecommitdiffstats
path: root/Source/cmWhileCommand.cxx
diff options
context:
space:
mode:
authorRegina Pfeifer <regina@mailbox.org>2019-07-30 20:58:40 (GMT)
committerRegina Pfeifer <regina@mailbox.org>2019-07-30 22:03:17 (GMT)
commit6491270e0d3699f5151c08ef41dce84724f9ffc1 (patch)
treef4caa3b0bc5262e73352394a4bb0ed534a765133 /Source/cmWhileCommand.cxx
parentaf24e4ef6e216184b8c207728d6b0312ce3c1525 (diff)
downloadCMake-6491270e0d3699f5151c08ef41dce84724f9ffc1.zip
CMake-6491270e0d3699f5151c08ef41dce84724f9ffc1.tar.gz
CMake-6491270e0d3699f5151c08ef41dce84724f9ffc1.tar.bz2
cmFunctionBlocker: Move check for matching args
Diffstat (limited to 'Source/cmWhileCommand.cxx')
-rw-r--r--Source/cmWhileCommand.cxx17
1 files changed, 6 insertions, 11 deletions
diff --git a/Source/cmWhileCommand.cxx b/Source/cmWhileCommand.cxx
index bacee58..1e442e5 100644
--- a/Source/cmWhileCommand.cxx
+++ b/Source/cmWhileCommand.cxx
@@ -27,7 +27,9 @@ public:
cm::string_view StartCommandName() const override { return "while"_s; }
cm::string_view EndCommandName() const override { return "endwhile"_s; }
- bool ShouldRemove(const cmListFileFunction& lff, cmMakefile& mf) override;
+ bool ArgumentsMatch(cmListFileFunction const& lff,
+ cmMakefile& mf) const override;
+
bool Replay(std::vector<cmListFileFunction> const& functions,
cmExecutionStatus& inStatus) override;
@@ -48,17 +50,10 @@ cmWhileFunctionBlocker::~cmWhileFunctionBlocker()
this->Makefile->PopLoopBlock();
}
-bool cmWhileFunctionBlocker::ShouldRemove(const cmListFileFunction& lff,
- cmMakefile&)
+bool cmWhileFunctionBlocker::ArgumentsMatch(cmListFileFunction const& lff,
+ cmMakefile&) const
{
- if (lff.Name.Lower == "endwhile") {
- // if the endwhile has arguments, then make sure
- // they match the arguments of the matching while
- if (lff.Arguments.empty() || lff.Arguments == this->Args) {
- return true;
- }
- }
- return false;
+ return lff.Arguments.empty() || lff.Arguments == this->Args;
}
bool cmWhileFunctionBlocker::Replay(