diff options
author | Alex Beregszaszi <alex@rtfs.hu> | 2017-06-30 17:21:06 +0800 |
---|---|---|
committer | Alex Beregszaszi <alex@rtfs.hu> | 2017-07-19 04:09:05 +0800 |
commit | c880550fbc29d474e68036db329b15fe421cd062 (patch) | |
tree | 6497f780ec5aeba3191b562bcc434787567068ad | |
parent | 01fbc636239f78134b37f9dedeacf40455ee2e0c (diff) | |
download | dexon-solidity-c880550fbc29d474e68036db329b15fe421cd062.tar dexon-solidity-c880550fbc29d474e68036db329b15fe421cd062.tar.gz dexon-solidity-c880550fbc29d474e68036db329b15fe421cd062.tar.bz2 dexon-solidity-c880550fbc29d474e68036db329b15fe421cd062.tar.lz dexon-solidity-c880550fbc29d474e68036db329b15fe421cd062.tar.xz dexon-solidity-c880550fbc29d474e68036db329b15fe421cd062.tar.zst dexon-solidity-c880550fbc29d474e68036db329b15fe421cd062.zip |
LLL: disable optimiser entirely if requested
-rw-r--r-- | liblll/Compiler.cpp | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/liblll/Compiler.cpp b/liblll/Compiler.cpp index 05376cd5..4ec11ca9 100644 --- a/liblll/Compiler.cpp +++ b/liblll/Compiler.cpp @@ -34,7 +34,10 @@ bytes dev::eth::compileLLL(string const& _src, bool _opt, vector<string>* _error { CompilerState cs; cs.populateStandard(); - bytes ret = CodeFragment::compile(_src, cs).assembly(cs).optimise(_opt).assemble().bytecode; + auto assembly = CodeFragment::compile(_src, cs).assembly(cs); + if (_opt) + assembly = assembly.optimise(true); + bytes ret = assembly.assemble().bytecode; for (auto i: cs.treesToKill) killBigints(i); return ret; @@ -70,7 +73,10 @@ std::string dev::eth::compileLLLToAsm(std::string const& _src, bool _opt, std::v CompilerState cs; cs.populateStandard(); stringstream ret; - CodeFragment::compile(_src, cs).assembly(cs).optimise(_opt).stream(ret); + auto assembly = CodeFragment::compile(_src, cs).assembly(cs); + if (_opt) + assembly = assembly.optimise(true); + assembly.stream(ret); for (auto i: cs.treesToKill) killBigints(i); return ret.str(); |