summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaniel Pfeifer <daniel@pfeifer-mail.de>2016-11-27 19:38:57 (GMT)
committerBrad King <brad.king@kitware.com>2016-11-29 18:53:29 (GMT)
commitd23a0196844f066047aa6942b69c6e591462df38 (patch)
tree2ba120b7447a65aa8dd7d5fe649491ea6a94bd4d
parent1afbe7d2cca61ecf483f7697b0141a233508603d (diff)
downloadCMake-d23a0196844f066047aa6942b69c6e591462df38.zip
CMake-d23a0196844f066047aa6942b69c6e591462df38.tar.gz
CMake-d23a0196844f066047aa6942b69c6e591462df38.tar.bz2
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.
-rw-r--r--Source/cmEndForEachCommand.cxx5
-rw-r--r--Source/cmEndForEachCommand.h13
-rw-r--r--Source/cmEndFunctionCommand.cxx5
-rw-r--r--Source/cmEndFunctionCommand.h13
-rw-r--r--Source/cmEndMacroCommand.cxx5
-rw-r--r--Source/cmEndMacroCommand.h13
-rw-r--r--Source/cmEndWhileCommand.cxx5
-rw-r--r--Source/cmEndWhileCommand.h13
8 files changed, 12 insertions, 60 deletions
diff --git a/Source/cmEndForEachCommand.cxx b/Source/cmEndForEachCommand.cxx
index fe6a7f3..81a37c3 100644
--- a/Source/cmEndForEachCommand.cxx
+++ b/Source/cmEndForEachCommand.cxx
@@ -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 "
diff --git a/Source/cmEndForEachCommand.h b/Source/cmEndForEachCommand.h
index 772a139..e480e72 100644
--- a/Source/cmEndForEachCommand.h
+++ b/Source/cmEndForEachCommand.h
@@ -10,7 +10,6 @@
#include "cmCommand.h"
class cmExecutionStatus;
-struct cmListFileArgument;
/** \class cmEndForEachCommand
* \brief ends an if block
@@ -26,21 +25,11 @@ 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.
diff --git a/Source/cmEndFunctionCommand.cxx b/Source/cmEndFunctionCommand.cxx
index 6adb42b..2d6b192 100644
--- a/Source/cmEndFunctionCommand.cxx
+++ b/Source/cmEndFunctionCommand.cxx
@@ -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 "
diff --git a/Source/cmEndFunctionCommand.h b/Source/cmEndFunctionCommand.h
index 2599637..b3cf8e6 100644
--- a/Source/cmEndFunctionCommand.h
+++ b/Source/cmEndFunctionCommand.h
@@ -10,7 +10,6 @@
#include "cmCommand.h"
class cmExecutionStatus;
-struct cmListFileArgument;
/** \class cmEndFunctionCommand
* \brief ends an if block
@@ -26,21 +25,11 @@ 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.
diff --git a/Source/cmEndMacroCommand.cxx b/Source/cmEndMacroCommand.cxx
index 046b0af..6429d7c 100644
--- a/Source/cmEndMacroCommand.cxx
+++ b/Source/cmEndMacroCommand.cxx
@@ -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 "
diff --git a/Source/cmEndMacroCommand.h b/Source/cmEndMacroCommand.h
index 3c462d4..bd7cdbd 100644
--- a/Source/cmEndMacroCommand.h
+++ b/Source/cmEndMacroCommand.h
@@ -10,7 +10,6 @@
#include "cmCommand.h"
class cmExecutionStatus;
-struct cmListFileArgument;
/** \class cmEndMacroCommand
* \brief ends an if block
@@ -26,21 +25,11 @@ 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.
diff --git a/Source/cmEndWhileCommand.cxx b/Source/cmEndWhileCommand.cxx
index 7201569..9c65bbe 100644
--- a/Source/cmEndWhileCommand.cxx
+++ b/Source/cmEndWhileCommand.cxx
@@ -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 "
diff --git a/Source/cmEndWhileCommand.h b/Source/cmEndWhileCommand.h
index d4e97b4..484d7c7 100644
--- a/Source/cmEndWhileCommand.h
+++ b/Source/cmEndWhileCommand.h
@@ -10,7 +10,6 @@
#include "cmCommand.h"
class cmExecutionStatus;
-struct cmListFileArgument;
/** \class cmEndWhileCommand
* \brief ends a while loop
@@ -26,21 +25,11 @@ 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.