From c76500949d3fcf5ff83ac6e7f1d565f5d786c5f0 Mon Sep 17 00:00:00 2001 From: Regina Pfeifer Date: Tue, 23 Jul 2019 23:00:28 +0200 Subject: cm*FunctionBlocker: Move to source file --- Source/cmForEachCommand.cxx | 19 +++++++++++++++++++ Source/cmForEachCommand.h | 20 -------------------- Source/cmFunctionCommand.cxx | 14 ++++++++++++++ Source/cmFunctionCommand.h | 15 --------------- Source/cmIfCommand.cxx | 17 +++++++++++++++++ Source/cmIfCommand.h | 20 +------------------- Source/cmMacroCommand.cxx | 14 ++++++++++++++ Source/cmMacroCommand.h | 15 --------------- Source/cmWhileCommand.cxx | 19 +++++++++++++++++++ Source/cmWhileCommand.h | 22 +--------------------- 10 files changed, 85 insertions(+), 90 deletions(-) diff --git a/Source/cmForEachCommand.cxx b/Source/cmForEachCommand.cxx index 06dce2c..b04f14c 100644 --- a/Source/cmForEachCommand.cxx +++ b/Source/cmForEachCommand.cxx @@ -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 Args; + std::vector Functions; + +private: + cmMakefile* Makefile; + int Depth; +}; + cmForEachFunctionBlocker::cmForEachFunctionBlocker(cmMakefile* mf) : Makefile(mf) , Depth(0) diff --git a/Source/cmForEachCommand.h b/Source/cmForEachCommand.h index cd112b8..135abf0 100644 --- a/Source/cmForEachCommand.h +++ b/Source/cmForEachCommand.h @@ -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 Args; - std::vector Functions; - -private: - cmMakefile* Makefile; - int Depth; -}; /// Starts foreach() ... endforeach() block class cmForEachCommand : public cmCommand diff --git a/Source/cmFunctionCommand.cxx b/Source/cmFunctionCommand.cxx index 2809cf7..f8230f1 100644 --- a/Source/cmFunctionCommand.cxx +++ b/Source/cmFunctionCommand.cxx @@ -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 Args; + std::vector Functions; + int Depth = 0; +}; + bool cmFunctionFunctionBlocker::IsFunctionBlocked( const cmListFileFunction& lff, cmMakefile& mf, cmExecutionStatus&) { diff --git a/Source/cmFunctionCommand.h b/Source/cmFunctionCommand.h index 449a180..b334525 100644 --- a/Source/cmFunctionCommand.h +++ b/Source/cmFunctionCommand.h @@ -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 Args; - std::vector Functions; - int Depth = 0; -}; /// Starts function() ... endfunction() block class cmFunctionCommand : public cmCommand diff --git a/Source/cmIfCommand.cxx b/Source/cmIfCommand.cxx index 385022c..20fe2f8 100644 --- a/Source/cmIfCommand.cxx +++ b/Source/cmIfCommand.cxx @@ -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 Args; + std::vector Functions; + bool IsBlocking; + bool HasRun = false; + bool ElseSeen = false; + unsigned int ScopeDepth = 0; +}; + //========================================================================= bool cmIfFunctionBlocker::IsFunctionBlocked(const cmListFileFunction& lff, cmMakefile& mf, diff --git a/Source/cmIfCommand.h b/Source/cmIfCommand.h index 775e609..820ffa4 100644 --- a/Source/cmIfCommand.h +++ b/Source/cmIfCommand.h @@ -7,26 +7,8 @@ #include -#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 Args; - std::vector Functions; - bool IsBlocking; - bool HasRun = false; - bool ElseSeen = false; - unsigned int ScopeDepth = 0; -}; +struct cmListFileArgument; /// Starts an if block bool cmIfCommand(std::vector const& args, diff --git a/Source/cmMacroCommand.cxx b/Source/cmMacroCommand.cxx index 1f2b5b2..a123f22 100644 --- a/Source/cmMacroCommand.cxx +++ b/Source/cmMacroCommand.cxx @@ -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 Args; + std::vector Functions; + int Depth = 0; +}; + bool cmMacroFunctionBlocker::IsFunctionBlocked(const cmListFileFunction& lff, cmMakefile& mf, cmExecutionStatus&) diff --git a/Source/cmMacroCommand.h b/Source/cmMacroCommand.h index 3ebd959..0d7083a 100644 --- a/Source/cmMacroCommand.h +++ b/Source/cmMacroCommand.h @@ -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 Args; - std::vector Functions; - int Depth = 0; -}; /// Starts macro() ... endmacro() block class cmMacroCommand : public cmCommand diff --git a/Source/cmWhileCommand.cxx b/Source/cmWhileCommand.cxx index 37d1c74..914860c 100644 --- a/Source/cmWhileCommand.cxx +++ b/Source/cmWhileCommand.cxx @@ -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 #include +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 Args; + std::vector Functions; + +private: + cmMakefile* Makefile; + int Depth; +}; + cmWhileFunctionBlocker::cmWhileFunctionBlocker(cmMakefile* mf) : Makefile(mf) , Depth(0) diff --git a/Source/cmWhileCommand.h b/Source/cmWhileCommand.h index 2257799..beca652 100644 --- a/Source/cmWhileCommand.h +++ b/Source/cmWhileCommand.h @@ -7,28 +7,8 @@ #include -#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 Args; - std::vector Functions; - -private: - cmMakefile* Makefile; - int Depth; -}; +struct cmListFileArgument; /// \brief Starts a while loop bool cmWhileCommand(std::vector const& args, -- cgit v0.12