cm*FunctionBlocker: Move to source file

This commit is contained in:
Regina Pfeifer 2019-07-23 23:00:28 +02:00
parent 89dc04af1d
commit c76500949d
10 changed files with 85 additions and 90 deletions

View File

@ -10,11 +10,30 @@
#include "cm_memory.hxx"
#include "cmExecutionStatus.h"
#include "cmFunctionBlocker.h"
#include "cmListFileCache.h"
#include "cmMakefile.h"
#include "cmMessageType.h"
#include "cmRange.h"
#include "cmSystemTools.h"
class cmForEachFunctionBlocker : public cmFunctionBlocker
{
public:
cmForEachFunctionBlocker(cmMakefile* mf);
~cmForEachFunctionBlocker() override;
bool IsFunctionBlocked(const cmListFileFunction& lff, cmMakefile& mf,
cmExecutionStatus&) override;
bool ShouldRemove(const cmListFileFunction& lff, cmMakefile& mf) override;
std::vector<std::string> Args;
std::vector<cmListFileFunction> Functions;
private:
cmMakefile* Makefile;
int Depth;
};
cmForEachFunctionBlocker::cmForEachFunctionBlocker(cmMakefile* mf)
: Makefile(mf)
, Depth(0)

View File

@ -11,28 +11,8 @@
#include "cm_memory.hxx"
#include "cmCommand.h"
#include "cmFunctionBlocker.h"
#include "cmListFileCache.h"
class cmExecutionStatus;
class cmMakefile;
class cmForEachFunctionBlocker : public cmFunctionBlocker
{
public:
cmForEachFunctionBlocker(cmMakefile* mf);
~cmForEachFunctionBlocker() override;
bool IsFunctionBlocked(const cmListFileFunction& lff, cmMakefile& mf,
cmExecutionStatus&) override;
bool ShouldRemove(const cmListFileFunction& lff, cmMakefile& mf) override;
std::vector<std::string> Args;
std::vector<cmListFileFunction> Functions;
private:
cmMakefile* Makefile;
int Depth;
};
/// Starts foreach() ... endforeach() block
class cmForEachCommand : public cmCommand

View File

@ -7,6 +7,8 @@
#include "cmAlgorithms.h"
#include "cmExecutionStatus.h"
#include "cmFunctionBlocker.h"
#include "cmListFileCache.h"
#include "cmMakefile.h"
#include "cmPolicies.h"
#include "cmRange.h"
@ -102,6 +104,18 @@ bool cmFunctionHelperCommand::operator()(
return true;
}
class cmFunctionFunctionBlocker : public cmFunctionBlocker
{
public:
bool IsFunctionBlocked(const cmListFileFunction&, cmMakefile& mf,
cmExecutionStatus&) override;
bool ShouldRemove(const cmListFileFunction&, cmMakefile& mf) override;
std::vector<std::string> Args;
std::vector<cmListFileFunction> Functions;
int Depth = 0;
};
bool cmFunctionFunctionBlocker::IsFunctionBlocked(
const cmListFileFunction& lff, cmMakefile& mf, cmExecutionStatus&)
{

View File

@ -11,23 +11,8 @@
#include "cm_memory.hxx"
#include "cmCommand.h"
#include "cmFunctionBlocker.h"
#include "cmListFileCache.h"
class cmExecutionStatus;
class cmMakefile;
class cmFunctionFunctionBlocker : public cmFunctionBlocker
{
public:
bool IsFunctionBlocked(const cmListFileFunction&, cmMakefile& mf,
cmExecutionStatus&) override;
bool ShouldRemove(const cmListFileFunction&, cmMakefile& mf) override;
std::vector<std::string> Args;
std::vector<cmListFileFunction> Functions;
int Depth = 0;
};
/// Starts function() ... endfunction() block
class cmFunctionCommand : public cmCommand

View File

@ -7,6 +7,8 @@
#include "cmConditionEvaluator.h"
#include "cmExecutionStatus.h"
#include "cmExpandedCommandArgument.h"
#include "cmFunctionBlocker.h"
#include "cmListFileCache.h"
#include "cmMakefile.h"
#include "cmMessageType.h"
#include "cmOutputConverter.h"
@ -28,6 +30,21 @@ static std::string cmIfCommandError(
return err;
}
class cmIfFunctionBlocker : public cmFunctionBlocker
{
public:
bool IsFunctionBlocked(const cmListFileFunction& lff, cmMakefile& mf,
cmExecutionStatus&) override;
bool ShouldRemove(const cmListFileFunction& lff, cmMakefile& mf) override;
std::vector<cmListFileArgument> Args;
std::vector<cmListFileFunction> Functions;
bool IsBlocking;
bool HasRun = false;
bool ElseSeen = false;
unsigned int ScopeDepth = 0;
};
//=========================================================================
bool cmIfFunctionBlocker::IsFunctionBlocked(const cmListFileFunction& lff,
cmMakefile& mf,

View File

@ -7,26 +7,8 @@
#include <vector>
#include "cmFunctionBlocker.h"
#include "cmListFileCache.h"
class cmExecutionStatus;
class cmMakefile;
class cmIfFunctionBlocker : public cmFunctionBlocker
{
public:
bool IsFunctionBlocked(const cmListFileFunction& lff, cmMakefile& mf,
cmExecutionStatus&) override;
bool ShouldRemove(const cmListFileFunction& lff, cmMakefile& mf) override;
std::vector<cmListFileArgument> Args;
std::vector<cmListFileFunction> Functions;
bool IsBlocking;
bool HasRun = false;
bool ElseSeen = false;
unsigned int ScopeDepth = 0;
};
struct cmListFileArgument;
/// Starts an if block
bool cmIfCommand(std::vector<cmListFileArgument> const& args,

View File

@ -10,6 +10,8 @@
#include "cmAlgorithms.h"
#include "cmExecutionStatus.h"
#include "cmFunctionBlocker.h"
#include "cmListFileCache.h"
#include "cmMakefile.h"
#include "cmPolicies.h"
#include "cmRange.h"
@ -136,6 +138,18 @@ bool cmMacroHelperCommand::operator()(
return true;
}
class cmMacroFunctionBlocker : public cmFunctionBlocker
{
public:
bool IsFunctionBlocked(const cmListFileFunction&, cmMakefile& mf,
cmExecutionStatus&) override;
bool ShouldRemove(const cmListFileFunction&, cmMakefile& mf) override;
std::vector<std::string> Args;
std::vector<cmListFileFunction> Functions;
int Depth = 0;
};
bool cmMacroFunctionBlocker::IsFunctionBlocked(const cmListFileFunction& lff,
cmMakefile& mf,
cmExecutionStatus&)

View File

@ -11,23 +11,8 @@
#include "cm_memory.hxx"
#include "cmCommand.h"
#include "cmFunctionBlocker.h"
#include "cmListFileCache.h"
class cmExecutionStatus;
class cmMakefile;
class cmMacroFunctionBlocker : public cmFunctionBlocker
{
public:
bool IsFunctionBlocked(const cmListFileFunction&, cmMakefile& mf,
cmExecutionStatus&) override;
bool ShouldRemove(const cmListFileFunction&, cmMakefile& mf) override;
std::vector<std::string> Args;
std::vector<cmListFileFunction> Functions;
int Depth = 0;
};
/// Starts macro() ... endmacro() block
class cmMacroCommand : public cmCommand

View File

@ -7,6 +7,8 @@
#include "cmConditionEvaluator.h"
#include "cmExecutionStatus.h"
#include "cmExpandedCommandArgument.h"
#include "cmFunctionBlocker.h"
#include "cmListFileCache.h"
#include "cmMakefile.h"
#include "cmMessageType.h"
#include "cmSystemTools.h"
@ -14,6 +16,23 @@
#include <string>
#include <utility>
class cmWhileFunctionBlocker : public cmFunctionBlocker
{
public:
cmWhileFunctionBlocker(cmMakefile* mf);
~cmWhileFunctionBlocker() override;
bool IsFunctionBlocked(const cmListFileFunction& lff, cmMakefile& mf,
cmExecutionStatus&) override;
bool ShouldRemove(const cmListFileFunction& lff, cmMakefile& mf) override;
std::vector<cmListFileArgument> Args;
std::vector<cmListFileFunction> Functions;
private:
cmMakefile* Makefile;
int Depth;
};
cmWhileFunctionBlocker::cmWhileFunctionBlocker(cmMakefile* mf)
: Makefile(mf)
, Depth(0)

View File

@ -7,28 +7,8 @@
#include <vector>
#include "cmFunctionBlocker.h"
#include "cmListFileCache.h"
class cmExecutionStatus;
class cmMakefile;
class cmWhileFunctionBlocker : public cmFunctionBlocker
{
public:
cmWhileFunctionBlocker(cmMakefile* mf);
~cmWhileFunctionBlocker() override;
bool IsFunctionBlocked(const cmListFileFunction& lff, cmMakefile& mf,
cmExecutionStatus&) override;
bool ShouldRemove(const cmListFileFunction& lff, cmMakefile& mf) override;
std::vector<cmListFileArgument> Args;
std::vector<cmListFileFunction> Functions;
private:
cmMakefile* Makefile;
int Depth;
};
struct cmListFileArgument;
/// \brief Starts a while loop
bool cmWhileCommand(std::vector<cmListFileArgument> const& args,