diff options
author | Regina Pfeifer <regina@mailbox.org> | 2019-07-30 21:54:12 (GMT) |
---|---|---|
committer | Kyle Edwards <kyle.edwards@kitware.com> | 2019-07-31 17:22:42 (GMT) |
commit | 41364824ad84a40c9906b7b5de492e45a74c8945 (patch) | |
tree | c53e0a60e2e2d1f736a9ce621a32b582e15285f1 | |
parent | 6491270e0d3699f5151c08ef41dce84724f9ffc1 (diff) | |
download | CMake-41364824ad84a40c9906b7b5de492e45a74c8945.zip CMake-41364824ad84a40c9906b7b5de492e45a74c8945.tar.gz CMake-41364824ad84a40c9906b7b5de492e45a74c8945.tar.bz2 |
cmFunctionBlocker: Recycle functions
-rw-r--r-- | Source/cmForEachCommand.cxx | 5 | ||||
-rw-r--r-- | Source/cmFunctionBlocker.cxx | 3 | ||||
-rw-r--r-- | Source/cmFunctionBlocker.h | 2 | ||||
-rw-r--r-- | Source/cmFunctionCommand.cxx | 6 | ||||
-rw-r--r-- | Source/cmIfCommand.cxx | 7 | ||||
-rw-r--r-- | Source/cmMacroCommand.cxx | 8 | ||||
-rw-r--r-- | Source/cmWhileCommand.cxx | 7 |
7 files changed, 18 insertions, 20 deletions
diff --git a/Source/cmForEachCommand.cxx b/Source/cmForEachCommand.cxx index 10ce459..1d961be 100644 --- a/Source/cmForEachCommand.cxx +++ b/Source/cmForEachCommand.cxx @@ -31,7 +31,7 @@ public: bool ArgumentsMatch(cmListFileFunction const& lff, cmMakefile& mf) const override; - bool Replay(std::vector<cmListFileFunction> const& functions, + bool Replay(std::vector<cmListFileFunction> functions, cmExecutionStatus& inStatus) override; std::vector<std::string> Args; @@ -60,8 +60,7 @@ bool cmForEachFunctionBlocker::ArgumentsMatch(cmListFileFunction const& lff, } bool cmForEachFunctionBlocker::Replay( - std::vector<cmListFileFunction> const& functions, - cmExecutionStatus& inStatus) + std::vector<cmListFileFunction> functions, cmExecutionStatus& inStatus) { cmMakefile& mf = inStatus.GetMakefile(); // at end of for each execute recorded commands diff --git a/Source/cmFunctionBlocker.cxx b/Source/cmFunctionBlocker.cxx index 437d4b5..5778a71 100644 --- a/Source/cmFunctionBlocker.cxx +++ b/Source/cmFunctionBlocker.cxx @@ -4,6 +4,7 @@ #include <cassert> #include <sstream> +#include <utility> #include "cmExecutionStatus.h" #include "cmMakefile.h" @@ -36,7 +37,7 @@ bool cmFunctionBlocker::IsFunctionBlocked(const cmListFileFunction& lff, mf.IssueMessage(MessageType::AUTHOR_WARNING, e.str()); } - return this->Replay(this->Functions, status); + return this->Replay(std::move(this->Functions), status); } } diff --git a/Source/cmFunctionBlocker.h b/Source/cmFunctionBlocker.h index 8b05993..87bdccd 100644 --- a/Source/cmFunctionBlocker.h +++ b/Source/cmFunctionBlocker.h @@ -42,7 +42,7 @@ private: virtual bool ArgumentsMatch(cmListFileFunction const& lff, cmMakefile& mf) const = 0; - virtual bool Replay(std::vector<cmListFileFunction> const& functions, + virtual bool Replay(std::vector<cmListFileFunction> functions, cmExecutionStatus& status) = 0; private: diff --git a/Source/cmFunctionCommand.cxx b/Source/cmFunctionCommand.cxx index dd0a5d0..610f516 100644 --- a/Source/cmFunctionCommand.cxx +++ b/Source/cmFunctionCommand.cxx @@ -116,7 +116,7 @@ public: bool ArgumentsMatch(cmListFileFunction const&, cmMakefile& mf) const override; - bool Replay(std::vector<cmListFileFunction> const& functions, + bool Replay(std::vector<cmListFileFunction> functions, cmExecutionStatus& status) override; std::vector<std::string> Args; @@ -132,13 +132,13 @@ bool cmFunctionFunctionBlocker::ArgumentsMatch(cmListFileFunction const& lff, } bool cmFunctionFunctionBlocker::Replay( - std::vector<cmListFileFunction> const& functions, cmExecutionStatus& status) + std::vector<cmListFileFunction> functions, cmExecutionStatus& status) { cmMakefile& mf = status.GetMakefile(); // create a new command and add it to cmake cmFunctionHelperCommand f; f.Args = this->Args; - f.Functions = functions; + f.Functions = std::move(functions); f.FilePath = this->GetStartingContext().FilePath; mf.RecordPolicies(f.Policies); mf.GetState()->AddScriptedCommand(this->Args[0], std::move(f)); diff --git a/Source/cmIfCommand.cxx b/Source/cmIfCommand.cxx index 418a74b..c5cfd8c 100644 --- a/Source/cmIfCommand.cxx +++ b/Source/cmIfCommand.cxx @@ -41,7 +41,7 @@ public: bool ArgumentsMatch(cmListFileFunction const& lff, cmMakefile&) const override; - bool Replay(std::vector<cmListFileFunction> const& functions, + bool Replay(std::vector<cmListFileFunction> functions, cmExecutionStatus& inStatus) override; std::vector<cmListFileArgument> Args; @@ -56,9 +56,8 @@ bool cmIfFunctionBlocker::ArgumentsMatch(cmListFileFunction const& lff, return lff.Arguments.empty() || lff.Arguments == this->Args; } -bool cmIfFunctionBlocker::Replay( - std::vector<cmListFileFunction> const& functions, - cmExecutionStatus& inStatus) +bool cmIfFunctionBlocker::Replay(std::vector<cmListFileFunction> functions, + cmExecutionStatus& inStatus) { cmMakefile& mf = inStatus.GetMakefile(); // execute the functions for the true parts of the if statement diff --git a/Source/cmMacroCommand.cxx b/Source/cmMacroCommand.cxx index eb328cc..8689c8f 100644 --- a/Source/cmMacroCommand.cxx +++ b/Source/cmMacroCommand.cxx @@ -149,7 +149,7 @@ public: bool ArgumentsMatch(cmListFileFunction const&, cmMakefile& mf) const override; - bool Replay(std::vector<cmListFileFunction> const& functions, + bool Replay(std::vector<cmListFileFunction> functions, cmExecutionStatus& status) override; std::vector<std::string> Args; @@ -164,15 +164,15 @@ bool cmMacroFunctionBlocker::ArgumentsMatch(cmListFileFunction const& lff, return expandedArguments.empty() || expandedArguments[0] == this->Args[0]; } -bool cmMacroFunctionBlocker::Replay( - std::vector<cmListFileFunction> const& functions, cmExecutionStatus& status) +bool cmMacroFunctionBlocker::Replay(std::vector<cmListFileFunction> functions, + cmExecutionStatus& status) { cmMakefile& mf = status.GetMakefile(); mf.AppendProperty("MACROS", this->Args[0].c_str()); // create a new command and add it to cmake cmMacroHelperCommand f; f.Args = this->Args; - f.Functions = functions; + f.Functions = std::move(functions); f.FilePath = this->GetStartingContext().FilePath; mf.RecordPolicies(f.Policies); mf.GetState()->AddScriptedCommand(this->Args[0], std::move(f)); diff --git a/Source/cmWhileCommand.cxx b/Source/cmWhileCommand.cxx index 1e442e5..a396852 100644 --- a/Source/cmWhileCommand.cxx +++ b/Source/cmWhileCommand.cxx @@ -30,7 +30,7 @@ public: bool ArgumentsMatch(cmListFileFunction const& lff, cmMakefile& mf) const override; - bool Replay(std::vector<cmListFileFunction> const& functions, + bool Replay(std::vector<cmListFileFunction> functions, cmExecutionStatus& inStatus) override; std::vector<cmListFileArgument> Args; @@ -56,9 +56,8 @@ bool cmWhileFunctionBlocker::ArgumentsMatch(cmListFileFunction const& lff, return lff.Arguments.empty() || lff.Arguments == this->Args; } -bool cmWhileFunctionBlocker::Replay( - std::vector<cmListFileFunction> const& functions, - cmExecutionStatus& inStatus) +bool cmWhileFunctionBlocker::Replay(std::vector<cmListFileFunction> functions, + cmExecutionStatus& inStatus) { cmMakefile& mf = inStatus.GetMakefile(); std::string errorString; |