Refactor: Keep cmWhileFunctionBlocker members private

Particularly `Args`.
This commit is contained in:
Alex Turbov
2021-08-10 01:04:32 +03:00
committed by Brad King
parent d22f68d019
commit 4c1cdfd8f0

View File

@@ -23,7 +23,7 @@
class cmWhileFunctionBlocker : public cmFunctionBlocker
{
public:
cmWhileFunctionBlocker(cmMakefile* mf);
cmWhileFunctionBlocker(cmMakefile* mf, std::vector<cmListFileArgument> args);
~cmWhileFunctionBlocker() override;
cm::string_view StartCommandName() const override { return "while"_s; }
@@ -35,14 +35,15 @@ public:
bool Replay(std::vector<cmListFileFunction> functions,
cmExecutionStatus& inStatus) override;
std::vector<cmListFileArgument> Args;
private:
cmMakefile* Makefile;
std::vector<cmListFileArgument> Args;
};
cmWhileFunctionBlocker::cmWhileFunctionBlocker(cmMakefile* mf)
: Makefile(mf)
cmWhileFunctionBlocker::cmWhileFunctionBlocker(
cmMakefile* const mf, std::vector<cmListFileArgument> args)
: Makefile{ mf }
, Args{ std::move(args) }
{
this->Makefile->PushLoopBlock();
}
@@ -132,11 +133,9 @@ bool cmWhileCommand(std::vector<cmListFileArgument> const& args,
}
// create a function blocker
{
auto& makefile = status.GetMakefile();
auto fb = cm::make_unique<cmWhileFunctionBlocker>(&makefile);
fb->Args = args;
makefile.AddFunctionBlocker(std::move(fb));
}
auto& makefile = status.GetMakefile();
makefile.AddFunctionBlocker(
cm::make_unique<cmWhileFunctionBlocker>(&makefile, args));
return true;
}