cmExecutionStatus: Remove function Clear

This commit is contained in:
Regina Pfeifer 2019-08-06 10:05:27 +02:00
parent 2327cc0e05
commit 5558070d52
3 changed files with 2 additions and 13 deletions

View File

@ -22,15 +22,6 @@ public:
{ {
} }
void Clear()
{
this->Error = "unknown error.";
this->ReturnInvoked = false;
this->BreakInvoked = false;
this->ContinueInvoked = false;
this->NestedError = false;
}
cmMakefile& GetMakefile() { return this->Makefile; } cmMakefile& GetMakefile() { return this->Makefile; }
void SetError(std::string const& e) { this->Error = e; } void SetError(std::string const& e) { this->Error = e; }

View File

@ -74,9 +74,8 @@ bool cmForEachFunctionBlocker::Replay(
// set the variable to the loop value // set the variable to the loop value
mf.AddDefinition(this->Args[0], arg); mf.AddDefinition(this->Args[0], arg);
// Invoke all the functions that were collected in the block. // Invoke all the functions that were collected in the block.
cmExecutionStatus status(mf);
for (cmListFileFunction const& func : functions) { for (cmListFileFunction const& func : functions) {
status.Clear(); cmExecutionStatus status(mf);
mf.ExecuteCommand(func, status); mf.ExecuteCommand(func, status);
if (status.GetReturnInvoked()) { if (status.GetReturnInvoked()) {
inStatus.SetReturnInvoked(); inStatus.SetReturnInvoked();

View File

@ -61,7 +61,6 @@ bool cmIfFunctionBlocker::Replay(std::vector<cmListFileFunction> functions,
{ {
cmMakefile& mf = inStatus.GetMakefile(); cmMakefile& mf = inStatus.GetMakefile();
// execute the functions for the true parts of the if statement // execute the functions for the true parts of the if statement
cmExecutionStatus status(mf);
int scopeDepth = 0; int scopeDepth = 0;
for (cmListFileFunction const& func : functions) { for (cmListFileFunction const& func : functions) {
// keep track of scope depth // keep track of scope depth
@ -147,7 +146,7 @@ bool cmIfFunctionBlocker::Replay(std::vector<cmListFileFunction> functions,
// should we execute? // should we execute?
else if (!this->IsBlocking) { else if (!this->IsBlocking) {
status.Clear(); cmExecutionStatus status(mf);
mf.ExecuteCommand(func, status); mf.ExecuteCommand(func, status);
if (status.GetReturnInvoked()) { if (status.GetReturnInvoked()) {
inStatus.SetReturnInvoked(); inStatus.SetReturnInvoked();