diff options
author | Yoichi Hirai <i@yoichihirai.com> | 2017-07-19 17:46:24 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-07-19 17:46:24 +0800 |
commit | 0d50e53739b7db826bb8b620a7ef16abdf3a534c (patch) | |
tree | d64ae85c9fee29374680cd3bce360a07be1c7280 | |
parent | 2a46e1b0e23b57f9333d4bf2fe0f402795581d61 (diff) | |
parent | c880550fbc29d474e68036db329b15fe421cd062 (diff) | |
download | dexon-solidity-0d50e53739b7db826bb8b620a7ef16abdf3a534c.tar dexon-solidity-0d50e53739b7db826bb8b620a7ef16abdf3a534c.tar.gz dexon-solidity-0d50e53739b7db826bb8b620a7ef16abdf3a534c.tar.bz2 dexon-solidity-0d50e53739b7db826bb8b620a7ef16abdf3a534c.tar.lz dexon-solidity-0d50e53739b7db826bb8b620a7ef16abdf3a534c.tar.xz dexon-solidity-0d50e53739b7db826bb8b620a7ef16abdf3a534c.tar.zst dexon-solidity-0d50e53739b7db826bb8b620a7ef16abdf3a534c.zip |
Merge pull request #2591 from ethereum/lll-no-optim
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(); |