From 0335ed4cb476ece63224a96c8ab660116ff08c3a Mon Sep 17 00:00:00 2001 From: chriseth Date: Fri, 11 Nov 2016 14:11:07 +0100 Subject: Simple peephole optimizer that is activated even if not requested. --- libsolidity/codegen/Compiler.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'libsolidity/codegen/Compiler.cpp') diff --git a/libsolidity/codegen/Compiler.cpp b/libsolidity/codegen/Compiler.cpp index eefa50c5..54639515 100644 --- a/libsolidity/codegen/Compiler.cpp +++ b/libsolidity/codegen/Compiler.cpp @@ -41,8 +41,7 @@ void Compiler::compileContract( ContractCompiler creationCompiler(&runtimeCompiler, m_context, m_optimize); m_runtimeSub = creationCompiler.compileConstructor(_contract, _contracts); - if (m_optimize) - m_context.optimise(m_optimizeRuns); + m_context.optimise(m_optimize, m_optimizeRuns); if (_contract.isLibrary()) { @@ -60,8 +59,7 @@ void Compiler::compileClone( ContractCompiler cloneCompiler(&runtimeCompiler, m_context, m_optimize); m_runtimeSub = cloneCompiler.compileClone(_contract, _contracts); - if (m_optimize) - m_context.optimise(m_optimizeRuns); + m_context.optimise(m_optimize, m_optimizeRuns); } eth::AssemblyItem Compiler::functionEntryLabel(FunctionDefinition const& _function) const -- cgit