MCPcopy Create free account
hub / github.com/argotorg/solidity / applyOptimisationSteps

Method applyOptimisationSteps

tools/yulPhaser/Program.cpp:185–207  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

183}
184
185std::unique_ptr<AST> Program::applyOptimisationSteps(
186 Dialect const& _dialect,
187 NameDispenser& _nameDispenser,
188 std::unique_ptr<AST> _ast,
189 std::vector<std::string> const& _optimisationSteps
190)
191{
192 // An empty set of reserved identifiers. It could be a constructor parameter but I don't
193 // think it would be useful in this tool. Other tools (like yulopti) have it empty too.
194 std::set<YulName> const externallyUsedIdentifiers = {};
195 OptimiserStepContext context{
196 _dialect,
197 _nameDispenser,
198 externallyUsedIdentifiers,
199 frontend::OptimiserSettings::standard().expectedExecutionsPerDeployment
200 };
201
202 auto astRoot = std::get<Block>(ASTCopier{}(_ast->root()));
203 for (std::string const& step: _optimisationSteps)
204 OptimiserSuite::allSteps().at(step)->run(context, astRoot);
205
206 return std::make_unique<AST>(_dialect, std::move(astRoot));
207}
208
209size_t Program::computeCodeSize(Block const& _ast, CodeWeights const& _weights)
210{

Callers

nothing calls this directly

Calls 2

atMethod · 0.80
runMethod · 0.45

Tested by

no test coverage detected