mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Remove Assembly::OptimiserSettings::translateSettings(..).
This commit is contained in:
parent
e57c137558
commit
4f76877753
@ -940,18 +940,3 @@ Assembly const* Assembly::subAssemblyById(size_t _subId) const
|
||||
assertThrow(currentAssembly != this, AssemblyException, "");
|
||||
return currentAssembly;
|
||||
}
|
||||
|
||||
Assembly::OptimiserSettings Assembly::OptimiserSettings::translateSettings(frontend::OptimiserSettings const& _settings, langutil::EVMVersion const& _evmVersion)
|
||||
{
|
||||
// Constructing it this way so that we notice changes in the fields.
|
||||
evmasm::Assembly::OptimiserSettings asmSettings{false, false, false, false, false, false, _evmVersion, 0};
|
||||
asmSettings.runInliner = _settings.runInliner;
|
||||
asmSettings.runJumpdestRemover = _settings.runJumpdestRemover;
|
||||
asmSettings.runPeephole = _settings.runPeephole;
|
||||
asmSettings.runDeduplicate = _settings.runDeduplicate;
|
||||
asmSettings.runCSE = _settings.runCSE;
|
||||
asmSettings.runConstantOptimiser = _settings.runConstantOptimiser;
|
||||
asmSettings.expectedExecutionsPerDeployment = _settings.expectedExecutionsPerDeployment;
|
||||
asmSettings.evmVersion = _evmVersion;
|
||||
return asmSettings;
|
||||
}
|
||||
|
@ -128,8 +128,6 @@ public:
|
||||
/// This specifies an estimate on how often each opcode in this assembly will be executed,
|
||||
/// i.e. use a small value to optimise for size and a large value to optimise for runtime gas usage.
|
||||
size_t expectedExecutionsPerDeployment = frontend::OptimiserSettings{}.expectedExecutionsPerDeployment;
|
||||
|
||||
static OptimiserSettings translateSettings(frontend::OptimiserSettings const& _settings, langutil::EVMVersion const& _evmVersion);
|
||||
};
|
||||
|
||||
/// Modify and return the current assembly such that creation and execution gas usage
|
||||
|
@ -574,7 +574,17 @@ void CompilerContext::updateSourceLocation()
|
||||
|
||||
evmasm::Assembly::OptimiserSettings CompilerContext::translateOptimiserSettings(OptimiserSettings const& _settings)
|
||||
{
|
||||
return evmasm::Assembly::OptimiserSettings::translateSettings(_settings, m_evmVersion);
|
||||
// Constructing it this way so that we notice changes in the fields.
|
||||
evmasm::Assembly::OptimiserSettings asmSettings{false, false, false, false, false, false, m_evmVersion, 0};
|
||||
asmSettings.runInliner = _settings.runInliner;
|
||||
asmSettings.runJumpdestRemover = _settings.runJumpdestRemover;
|
||||
asmSettings.runPeephole = _settings.runPeephole;
|
||||
asmSettings.runDeduplicate = _settings.runDeduplicate;
|
||||
asmSettings.runCSE = _settings.runCSE;
|
||||
asmSettings.runConstantOptimiser = _settings.runConstantOptimiser;
|
||||
asmSettings.expectedExecutionsPerDeployment = _settings.expectedExecutionsPerDeployment;
|
||||
asmSettings.evmVersion = m_evmVersion;
|
||||
return asmSettings;
|
||||
}
|
||||
|
||||
evmasm::AssemblyItem CompilerContext::FunctionCompilationQueue::entryLabel(
|
||||
|
@ -686,8 +686,16 @@ bool CompilerStack::compile(State _stopAfter)
|
||||
string const evmSourceName = m_evmAssemblyJson.begin()->first;
|
||||
Json::Value const evmJson = m_evmAssemblyJson.begin()->second;
|
||||
|
||||
evmasm::Assembly::OptimiserSettings optimiserSettings =
|
||||
evmasm::Assembly::OptimiserSettings::translateSettings(m_optimiserSettings, m_evmVersion);
|
||||
// todo: remove code duplication.
|
||||
evmasm::Assembly::OptimiserSettings optimiserSettings{false, false, false, false, false, false, m_evmVersion, 0};
|
||||
optimiserSettings.runInliner = m_optimiserSettings.runInliner;
|
||||
optimiserSettings.runJumpdestRemover = m_optimiserSettings.runJumpdestRemover;
|
||||
optimiserSettings.runPeephole = m_optimiserSettings.runPeephole;
|
||||
optimiserSettings.runDeduplicate = m_optimiserSettings.runDeduplicate;
|
||||
optimiserSettings.runCSE = m_optimiserSettings.runCSE;
|
||||
optimiserSettings.runConstantOptimiser = m_optimiserSettings.runConstantOptimiser;
|
||||
optimiserSettings.expectedExecutionsPerDeployment = m_optimiserSettings.expectedExecutionsPerDeployment;
|
||||
optimiserSettings.evmVersion = m_evmVersion;
|
||||
|
||||
m_contracts[evmSourceName].evmAssembly = evmasm::Assembly::loadFromAssemblyJSON(m_evmAssemblyJson[evmSourceName]);
|
||||
if (m_optimiserSettings.enabled)
|
||||
|
Loading…
Reference in New Issue
Block a user