Optimizer context has parameter expectedExecutionsPerDeployment

This commit is contained in:
hrkrshnn
2021-04-22 17:27:57 +02:00
parent 074f22f22c
commit 1f5b874eaf
9 changed files with 49 additions and 9 deletions
+8 -1
View File
@@ -41,6 +41,8 @@
#include <libsolutil/JSON.h>
#include <libsolidity/interface/OptimiserSettings.h>
#include <cassert>
#include <memory>
@@ -201,7 +203,12 @@ unique_ptr<Block> Program::applyOptimisationSteps(
// An empty set of reserved identifiers. It could be a constructor parameter but I don't
// think it would be useful in this tool. Other tools (like yulopti) have it empty too.
set<YulString> const externallyUsedIdentifiers = {};
OptimiserStepContext context{_dialect, _nameDispenser, externallyUsedIdentifiers};
OptimiserStepContext context{
_dialect,
_nameDispenser,
externallyUsedIdentifiers,
frontend::OptimiserSettings::standard().expectedExecutionsPerDeployment
};
for (string const& step: _optimisationSteps)
OptimiserSuite::allSteps().at(step)->run(context, *_ast);