aboutsummaryrefslogtreecommitdiffstats
path: root/libsolidity/SolidityOptimizer.cpp
diff options
context:
space:
mode:
authorchriseth <c@ethdev.com>2015-05-05 23:45:58 +0800
committerchriseth <c@ethdev.com>2015-05-06 18:55:18 +0800
commita0cc8abb2a162f883b5afd4757f52d926cf6df0b (patch)
tree1e6bad831d5a873a7f6b0693f5e6071c71c66fb2 /libsolidity/SolidityOptimizer.cpp
parent3649c1fc60bf64171f843ec1cb73697b9f0ebd3f (diff)
downloaddexon-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.
Diffstat (limited to 'libsolidity/SolidityOptimizer.cpp')
-rw-r--r--libsolidity/SolidityOptimizer.cpp8
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());
}