Set the error after argument expansion in end commands

The current code is optimized for rare error cases.  Simplify the code
and remove these optimizations.
This commit is contained in:
Daniel Pfeifer authored and Brad King committed 2016-11-29 13:53:29 -05:00
1 parent 1afbe7d2cc
commit d23a019684
8 files changed
+12 -60

No files matched your search

+2 -3
View File
@@ -3,10 +3,9 @@
#include "cmEndForEachCommand.h"
class cmExecutionStatus;
struct cmListFileArgument;
bool cmEndForEachCommand::InvokeInitialPass(
std::vector<cmListFileArgument> const&, cmExecutionStatus&)
bool cmEndForEachCommand::InitialPass(std::vector<std::string> const&,
cmExecutionStatus&)
{
this->SetError("An ENDFOREACH command was found outside of a proper "
"FOREACH ENDFOREACH structure. Or its arguments did "
+1 -12
View File
@@ -10,7 +10,6 @@
#include "cmCommand.h"
class cmExecutionStatus;
struct cmListFileArgument;
/** \class cmEndForEachCommand
* \brief ends an if block
@@ -25,22 +24,12 @@ public:
*/
cmCommand* Clone() CM_OVERRIDE { return new cmEndForEachCommand; }
/**
* Override cmCommand::InvokeInitialPass to get arguments before
* expansion.
*/
bool InvokeInitialPass(std::vector<cmListFileArgument> const&,
cmExecutionStatus&) CM_OVERRIDE;
/**
* This is called when the command is first encountered in
* the CMakeLists.txt file.
*/
bool InitialPass(std::vector<std::string> const&,
cmExecutionStatus&) CM_OVERRIDE
{
return false;
}
cmExecutionStatus&) CM_OVERRIDE;
/**
* This determines if the command is invoked when in script mode.
+2 -3
View File
@@ -3,10 +3,9 @@
#include "cmEndFunctionCommand.h"
class cmExecutionStatus;
struct cmListFileArgument;
bool cmEndFunctionCommand::InvokeInitialPass(
std::vector<cmListFileArgument> const&, cmExecutionStatus&)
bool cmEndFunctionCommand::InitialPass(std::vector<std::string> const&,
cmExecutionStatus&)
{
this->SetError("An ENDFUNCTION command was found outside of a proper "
"FUNCTION ENDFUNCTION structure. Or its arguments did not "
+1 -12
View File
@@ -10,7 +10,6 @@
#include "cmCommand.h"
class cmExecutionStatus;
struct cmListFileArgument;
/** \class cmEndFunctionCommand
* \brief ends an if block
@@ -25,22 +24,12 @@ public:
*/
cmCommand* Clone() CM_OVERRIDE { return new cmEndFunctionCommand; }
/**
* Override cmCommand::InvokeInitialPass to get arguments before
* expansion.
*/
bool InvokeInitialPass(std::vector<cmListFileArgument> const&,
cmExecutionStatus&) CM_OVERRIDE;
/**
* This is called when the command is first encountered in
* the CMakeLists.txt file.
*/
bool InitialPass(std::vector<std::string> const&,
cmExecutionStatus&) CM_OVERRIDE
{
return false;
}
cmExecutionStatus&) CM_OVERRIDE;
/**
* This determines if the command is invoked when in script mode.
+2 -3
View File
@@ -3,10 +3,9 @@
#include "cmEndMacroCommand.h"
class cmExecutionStatus;
struct cmListFileArgument;
bool cmEndMacroCommand::InvokeInitialPass(
std::vector<cmListFileArgument> const&, cmExecutionStatus&)
bool cmEndMacroCommand::InitialPass(std::vector<std::string> const&,
cmExecutionStatus&)
{
this->SetError("An ENDMACRO command was found outside of a proper "
"MACRO ENDMACRO structure. Or its arguments did not "
+1 -12
View File
@@ -10,7 +10,6 @@
#include "cmCommand.h"
class cmExecutionStatus;
struct cmListFileArgument;
/** \class cmEndMacroCommand
* \brief ends an if block
@@ -25,22 +24,12 @@ public:
*/
cmCommand* Clone() CM_OVERRIDE { return new cmEndMacroCommand; }
/**
* Override cmCommand::InvokeInitialPass to get arguments before
* expansion.
*/
bool InvokeInitialPass(std::vector<cmListFileArgument> const&,
cmExecutionStatus&) CM_OVERRIDE;
/**
* This is called when the command is first encountered in
* the CMakeLists.txt file.
*/
bool InitialPass(std::vector<std::string> const&,
cmExecutionStatus&) CM_OVERRIDE
{
return false;
}
cmExecutionStatus&) CM_OVERRIDE;
/**
* This determines if the command is invoked when in script mode.
+2 -3
View File
@@ -3,10 +3,9 @@
#include "cmEndWhileCommand.h"
class cmExecutionStatus;
struct cmListFileArgument;
bool cmEndWhileCommand::InvokeInitialPass(
std::vector<cmListFileArgument> const&, cmExecutionStatus&)
bool cmEndWhileCommand::InitialPass(std::vector<std::string> const&,
cmExecutionStatus&)
{
this->SetError("An ENDWHILE command was found outside of a proper "
"WHILE ENDWHILE structure. Or its arguments did not "
+1 -12
View File
@@ -10,7 +10,6 @@
#include "cmCommand.h"
class cmExecutionStatus;
struct cmListFileArgument;
/** \class cmEndWhileCommand
* \brief ends a while loop
@@ -25,22 +24,12 @@ public:
*/
cmCommand* Clone() CM_OVERRIDE { return new cmEndWhileCommand; }
/**
* Override cmCommand::InvokeInitialPass to get arguments before
* expansion.
*/
bool InvokeInitialPass(std::vector<cmListFileArgument> const& args,
cmExecutionStatus& status) CM_OVERRIDE;
/**
* This is called when the command is first encountered in
* the CMakeLists.txt file.
*/
bool InitialPass(std::vector<std::string> const&,
cmExecutionStatus&) CM_OVERRIDE
{
return false;
}
cmExecutionStatus&) CM_OVERRIDE;
/**
* This determines if the command is invoked when in script mode.