diff options
author | chriseth <c@ethdev.com> | 2015-05-05 23:45:58 +0800 |
---|---|---|
committer | chriseth <c@ethdev.com> | 2015-05-06 18:55:18 +0800 |
commit | a0cc8abb2a162f883b5afd4757f52d926cf6df0b (patch) | |
tree | 1e6bad831d5a873a7f6b0693f5e6071c71c66fb2 | |
parent | 3649c1fc60bf64171f843ec1cb73697b9f0ebd3f (diff) | |
download | dexon-solidity-a0cc8abb2a162f883b5afd4757f52d926cf6df0b.tar dexon-solidity-a0cc8abb2a162f883b5afd4757f52d926cf6df0b.tar.gz dexon-solidity-a0cc8abb2a162f883b5afd4757f52d926cf6df0b.tar.bz2 dexon-solidity-a0cc8abb2a162f883b5afd4757f52d926cf6df0b.tar.lz dexon-solidity-a0cc8abb2a162f883b5afd4757f52d926cf6df0b.tar.xz dexon-solidity-a0cc8abb2a162f883b5afd4757f52d926cf6df0b.tar.zst dexon-solidity-a0cc8abb2a162f883b5afd4757f52d926cf6df0b.zip |
CFG returns vector of blocks instead of assembly items.
-rw-r--r-- | libsolidity/SolidityOptimizer.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/libsolidity/SolidityOptimizer.cpp b/libsolidity/SolidityOptimizer.cpp index 59e8f04a..3cb6a536 100644 --- a/libsolidity/SolidityOptimizer.cpp +++ b/libsolidity/SolidityOptimizer.cpp @@ -131,8 +131,12 @@ public: // Running it four times should be enough for these tests. for (unsigned i = 0; i < 4; ++i) { - eth::ControlFlowGraph cfg(output); - output = cfg.optimisedItems(); + ControlFlowGraph cfg(output); + AssemblyItems optItems; + for (BasicBlock const& block: cfg.optimisedBlocks()) + copy(output.begin() + block.begin, output.begin() + block.end, + back_inserter(optItems)); + output = move(optItems); } BOOST_CHECK_EQUAL_COLLECTIONS(_expectation.begin(), _expectation.end(), output.begin(), output.end()); } |