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
@@ -42,6 +42,8 @@
#include <liblangutil/Scanner.h>
#include <liblangutil/SourceReferenceFormatter.h>
#include <libsolidity/interface/OptimiserSettings.h>
// The following headers are generated from the
// yul files placed in libyul/backends/wasm/polyfill.
@@ -68,7 +70,13 @@ Object EVMToEwasmTranslator::run(Object const& _object)
Block ast = std::get<Block>(Disambiguator(m_dialect, *_object.analysisInfo)(*_object.code));
set<YulString> reservedIdentifiers;
NameDispenser nameDispenser{m_dialect, ast, reservedIdentifiers};
OptimiserStepContext context{m_dialect, nameDispenser, reservedIdentifiers};
// expectedExecutionsPerDeployment is currently unused.
OptimiserStepContext context{
m_dialect,
nameDispenser,
reservedIdentifiers,
frontend::OptimiserSettings::standard().expectedExecutionsPerDeployment
};
FunctionHoister::run(context, ast);
FunctionGrouper::run(context, ast);