aboutsummaryrefslogtreecommitdiffstats
path: root/libsolidity
diff options
context:
space:
mode:
authorchriseth <c@ethdev.com>2015-04-30 00:16:05 +0800
committerchriseth <c@ethdev.com>2015-05-06 17:09:55 +0800
commit8416a6260f3545ae7109091a09bef9291db59179 (patch)
treed7e2fe71cf133084cebed9d783222361abf5d5b2 /libsolidity
parentfce1a7f82e48ddf3d73e00a2998f003d77f3d5f9 (diff)
downloaddexon-solidity-8416a6260f3545ae7109091a09bef9291db59179.tar.gz
dexon-solidity-8416a6260f3545ae7109091a09bef9291db59179.tar.zst
dexon-solidity-8416a6260f3545ae7109091a09bef9291db59179.zip
Split known state from common subexpression eliminator.
Diffstat (limited to 'libsolidity')
-rw-r--r--libsolidity/SolidityOptimizer.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/libsolidity/SolidityOptimizer.cpp b/libsolidity/SolidityOptimizer.cpp
index 9cdaa588..71463f91 100644
--- a/libsolidity/SolidityOptimizer.cpp
+++ b/libsolidity/SolidityOptimizer.cpp
@@ -90,7 +90,8 @@ public:
for (AssemblyItem& item: input)
item.setLocation(SourceLocation(1, 3, make_shared<string>("")));
- eth::CommonSubexpressionEliminator cse;
+ eth::KnownState state;
+ eth::CommonSubexpressionEliminator cse(state);
BOOST_REQUIRE(cse.feedItems(input.begin(), input.end()) == input.end());
AssemblyItems output = cse.getOptimizedItems();
@@ -231,7 +232,8 @@ BOOST_AUTO_TEST_CASE(function_calls)
BOOST_AUTO_TEST_CASE(cse_intermediate_swap)
{
- eth::CommonSubexpressionEliminator cse;
+ eth::KnownState state;
+ eth::CommonSubexpressionEliminator cse(state);
AssemblyItems input{
Instruction::SWAP1, Instruction::POP, Instruction::ADD, u256(0), Instruction::SWAP1,
Instruction::SLOAD, Instruction::SWAP1, u256(100), Instruction::EXP, Instruction::SWAP1,