diff --git a/libyul/CMakeLists.txt b/libyul/CMakeLists.txt
index dee8d1224..c0e173246 100644
--- a/libyul/CMakeLists.txt
+++ b/libyul/CMakeLists.txt
@@ -88,6 +88,8 @@ add_library(yul
optimiser/ExpressionSplitter.h
optimiser/ForLoopConditionIntoBody.cpp
optimiser/ForLoopConditionIntoBody.h
+ optimiser/ForLoopConditionOutOfBody.cpp
+ optimiser/ForLoopConditionOutOfBody.h
optimiser/ForLoopInitRewriter.cpp
optimiser/ForLoopInitRewriter.h
optimiser/FullInliner.cpp
diff --git a/libyul/optimiser/ForLoopConditionOutOfBody.cpp b/libyul/optimiser/ForLoopConditionOutOfBody.cpp
new file mode 100644
index 000000000..d0cc3a441
--- /dev/null
+++ b/libyul/optimiser/ForLoopConditionOutOfBody.cpp
@@ -0,0 +1,69 @@
+/*
+ This file is part of solidity.
+
+ solidity is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ solidity is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with solidity. If not, see .
+*/
+
+#include
+#include
+#include
+#include
+#include
+
+using namespace std;
+using namespace dev;
+using namespace yul;
+
+void ForLoopConditionOutOfBody::operator()(ForLoop& _forLoop)
+{
+ ASTModifier::operator()(_forLoop);
+
+ if (
+ !m_dialect.booleanNegationFunction() ||
+ _forLoop.condition->type() != typeid(Literal) ||
+ valueOfLiteral(boost::get(*_forLoop.condition)) == u256(0) ||
+ _forLoop.body.statements.empty() ||
+ _forLoop.body.statements.front().type() != typeid(If)
+ )
+ return;
+
+ If& firstStatement = boost::get(_forLoop.body.statements.front());
+ if (
+ firstStatement.body.statements.empty() ||
+ firstStatement.body.statements.front().type() != typeid(Break)
+ )
+ return;
+ if (!SideEffectsCollector(m_dialect, *firstStatement.condition).movable())
+ return;
+
+ YulString iszero = m_dialect.booleanNegationFunction()->name;
+ langutil::SourceLocation location = locationOf(*firstStatement.condition);
+
+ if (
+ firstStatement.condition->type() == typeid(FunctionCall) &&
+ boost::get(*firstStatement.condition).functionName.name == iszero
+ )
+ _forLoop.condition = make_unique(std::move(boost::get(*firstStatement.condition).arguments.front()));
+ else
+ _forLoop.condition = make_unique(FunctionCall{
+ location,
+ Identifier{location, iszero},
+ make_vector(
+ std::move(*firstStatement.condition)
+ )
+ });
+
+ _forLoop.body.statements.erase(_forLoop.body.statements.begin());
+}
+
diff --git a/libyul/optimiser/ForLoopConditionOutOfBody.h b/libyul/optimiser/ForLoopConditionOutOfBody.h
new file mode 100644
index 000000000..baa4c62d4
--- /dev/null
+++ b/libyul/optimiser/ForLoopConditionOutOfBody.h
@@ -0,0 +1,69 @@
+/*
+ This file is part of solidity.
+
+ solidity is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ solidity is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with solidity. If not, see .
+*/
+#pragma once
+
+#include
+#include
+
+namespace yul
+{
+
+/**
+ * Reverses the transformation of ForLoopConditionIntoBody.
+ *
+ * For any movable ``c``, it turns
+ *
+ * for { ... } 1 { ... } {
+ * if iszero(c) { break }
+ * ...
+ * }
+ *
+ * into
+ *
+ * for { ... } c { ... } {
+ * ...
+ * }
+ *
+ * and it turns
+ *
+ * for { ... } 1 { ... } {
+ * if c { break }
+ * ...
+ * }
+ *
+ * into
+ *
+ * for { ... } iszero(c) { ... } {
+ * ...
+ * }
+ *
+ * The LiteralRematerialiser should be run before this step.
+ */
+class ForLoopConditionOutOfBody: public ASTModifier
+{
+public:
+ ForLoopConditionOutOfBody(Dialect const& _dialect):
+ m_dialect(_dialect)
+ {}
+ using ASTModifier::operator();
+ void operator()(ForLoop& _forLoop) override;
+
+private:
+ Dialect const& m_dialect;
+};
+
+}
diff --git a/libyul/optimiser/Suite.cpp b/libyul/optimiser/Suite.cpp
index 97feac36b..88776a584 100644
--- a/libyul/optimiser/Suite.cpp
+++ b/libyul/optimiser/Suite.cpp
@@ -34,6 +34,7 @@
#include
#include
#include
+#include
#include
#include
#include
@@ -127,12 +128,14 @@ void OptimiserSuite::run(
{
// still in SSA, perform structural simplification
- ControlFlowSimplifier{_dialect}(ast);
LiteralRematerialiser{_dialect}(ast);
+ ForLoopConditionOutOfBody{_dialect}(ast);
+ ControlFlowSimplifier{_dialect}(ast);
StructuralSimplifier{}(ast);
ControlFlowSimplifier{_dialect}(ast);
BlockFlattener{}(ast);
DeadCodeEliminator{_dialect}(ast);
+ ForLoopConditionIntoBody{_dialect}(ast);
UnusedPruner::runUntilStabilisedOnFullAST(_dialect, ast, reservedIdentifiers);
}
@@ -187,6 +190,7 @@ void OptimiserSuite::run(
LoadResolver::run(_dialect, ast);
ExpressionSimplifier::run(_dialect, ast);
LiteralRematerialiser{_dialect}(ast);
+ ForLoopConditionOutOfBody{_dialect}(ast);
StructuralSimplifier{}(ast);
BlockFlattener{}(ast);
DeadCodeEliminator{_dialect}(ast);
@@ -195,6 +199,7 @@ void OptimiserSuite::run(
SSATransform::run(ast, dispenser);
RedundantAssignEliminator::run(_dialect, ast);
RedundantAssignEliminator::run(_dialect, ast);
+ ForLoopConditionIntoBody{_dialect}(ast);
UnusedPruner::runUntilStabilisedOnFullAST(_dialect, ast, reservedIdentifiers);
CommonSubexpressionEliminator::run(_dialect, ast);
}
@@ -212,6 +217,9 @@ void OptimiserSuite::run(
SSAReverser::run(ast);
CommonSubexpressionEliminator::run(_dialect, ast);
+ LiteralRematerialiser{_dialect}(ast);
+ ForLoopConditionOutOfBody{_dialect}(ast);
+ CommonSubexpressionEliminator::run(_dialect, ast);
UnusedPruner::runUntilStabilisedOnFullAST(_dialect, ast, reservedIdentifiers);
ExpressionJoiner::run(ast);
@@ -232,6 +240,9 @@ void OptimiserSuite::run(
BlockFlattener{}(ast);
DeadCodeEliminator{_dialect}(ast);
ControlFlowSimplifier{_dialect}(ast);
+ LiteralRematerialiser{_dialect}(ast);
+ ForLoopConditionOutOfBody{_dialect}(ast);
+ CommonSubexpressionEliminator::run(_dialect, ast);
FunctionGrouper{}(ast);
diff --git a/test/cmdlineTests/standard_eWasm_requested/output.json b/test/cmdlineTests/standard_eWasm_requested/output.json
index e766c2156..17469c367 100644
--- a/test/cmdlineTests/standard_eWasm_requested/output.json
+++ b/test/cmdlineTests/standard_eWasm_requested/output.json
@@ -26,9 +26,9 @@
(param $x4 i64)
(result i64)
(local $v i64)
- (if (i64.ne (i64.const 0) (i64.or (i64.or (get_local $x1) (get_local $x2)) (get_local $x3))) (then
+ (if (i64.ne (get_local $v) (i64.or (i64.or (get_local $x1) (get_local $x2)) (get_local $x3))) (then
(unreachable)))
- (if (i64.ne (i64.const 0) (i64.shr_u (get_local $x4) (i64.const 32))) (then
+ (if (i64.ne (get_local $v) (i64.shr_u (get_local $x4) (i64.const 32))) (then
(unreachable)))
(set_local $v (get_local $x4))
(get_local $v)
@@ -107,9 +107,9 @@
(param $x4 i64)
(result i64)
(local $v i64)
- (if (i64.ne (i64.const 0) (i64.or (i64.or (get_local $x1) (get_local $x2)) (get_local $x3))) (then
+ (if (i64.ne (get_local $v) (i64.or (i64.or (get_local $x1) (get_local $x2)) (get_local $x3))) (then
(unreachable)))
- (if (i64.ne (i64.const 0) (i64.shr_u (get_local $x4) (i64.const 32))) (then
+ (if (i64.ne (get_local $v) (i64.shr_u (get_local $x4) (i64.const 32))) (then
(unreachable)))
(set_local $v (get_local $x4))
(get_local $v)
diff --git a/test/libsolidity/gasTests/abiv2_optimised.sol b/test/libsolidity/gasTests/abiv2_optimised.sol
index f22576380..83d07911f 100644
--- a/test/libsolidity/gasTests/abiv2_optimised.sol
+++ b/test/libsolidity/gasTests/abiv2_optimised.sol
@@ -17,9 +17,9 @@ contract C {
// optimize-yul: true
// ----
// creation:
-// codeDepositCost: 624200
-// executionCost: 657
-// totalCost: 624857
+// codeDepositCost: 608400
+// executionCost: 645
+// totalCost: 609045
// external:
// a(): 429
// b(uint256): 884
diff --git a/test/libyul/YulOptimizerTest.cpp b/test/libyul/YulOptimizerTest.cpp
index b0d6d928c..399d39b55 100644
--- a/test/libyul/YulOptimizerTest.cpp
+++ b/test/libyul/YulOptimizerTest.cpp
@@ -36,6 +36,7 @@
#include
#include
#include
+#include
#include
#include
#include
diff --git a/test/libyul/yulOptimizerTests/fullSuite/abi_example1.yul b/test/libyul/yulOptimizerTests/fullSuite/abi_example1.yul
index 6d2a36895..4838eab02 100644
--- a/test/libyul/yulOptimizerTests/fullSuite/abi_example1.yul
+++ b/test/libyul/yulOptimizerTests/fullSuite/abi_example1.yul
@@ -465,21 +465,19 @@
// let _1 := 0
// let _2 := mload(_1)
// let pos := 0x20
-// let pos_1 := pos
// let length := mload(_2)
// mstore(pos, length)
// pos := 64
-// let srcPtr := add(_2, pos_1)
+// let srcPtr := add(_2, 0x20)
// let i := _1
-// for { } 1 { i := add(i, 1) }
+// for { } lt(i, length) { i := add(i, 1) }
// {
-// if iszero(lt(i, length)) { break }
// abi_encode_t_array$_t_contract$_C_$55_$3_memory_to_t_array$_t_address_$3_memory_ptr(mload(srcPtr), pos)
-// srcPtr := add(srcPtr, pos_1)
+// srcPtr := add(srcPtr, 0x20)
// pos := add(pos, 0x60)
// }
// let _3 := mload(64)
-// let _4 := mload(pos_1)
+// let _4 := mload(0x20)
// if slt(sub(_3, _4), 128) { revert(_1, _1) }
// let offset := calldataload(add(_4, 64))
// let _5 := 0xffffffffffffffff
@@ -488,7 +486,7 @@
// let offset_1 := calldataload(add(_4, 96))
// if gt(offset_1, _5) { revert(_1, _1) }
// let value3 := abi_decode_t_array$_t_array$_t_uint256_$2_memory_$dyn_memory_ptr(add(_4, offset_1), _3)
-// sstore(calldataload(_4), calldataload(add(_4, pos_1)))
+// sstore(calldataload(_4), calldataload(add(_4, 0x20)))
// sstore(value2, value3)
// sstore(_1, pos)
// }
@@ -504,9 +502,8 @@
// let src := add(offset, _1)
// if gt(add(add(offset, mul(length, 0x40)), _1), end) { revert(0, 0) }
// let i := 0
-// for { } 1 { i := add(i, 1) }
+// for { } lt(i, length) { i := add(i, 1) }
// {
-// if iszero(lt(i, length)) { break }
// if iszero(slt(add(src, 0x1f), end)) { revert(0, 0) }
// let dst_1 := allocateMemory(array_allocation_size_t_array$_t_uint256_$2_memory(0x2))
// let dst_2 := dst_1
@@ -514,9 +511,8 @@
// let _2 := add(src, 0x40)
// if gt(_2, end) { revert(0, 0) }
// let i_1 := 0
-// for { } 1 { i_1 := add(i_1, 1) }
+// for { } lt(i_1, 0x2) { i_1 := add(i_1, 1) }
// {
-// if iszero(lt(i_1, 0x2)) { break }
// mstore(dst_1, calldataload(src_1))
// dst_1 := add(dst_1, _1)
// src_1 := add(src_1, _1)
@@ -538,9 +534,8 @@
// let src := add(offset, _1)
// if gt(add(add(offset, mul(length, _1)), _1), end) { revert(0, 0) }
// let i := 0
-// for { } 1 { i := add(i, 1) }
+// for { } lt(i, length) { i := add(i, 1) }
// {
-// if iszero(lt(i, length)) { break }
// mstore(dst, calldataload(src))
// dst := add(dst, _1)
// src := add(src, _1)
@@ -550,9 +545,8 @@
// {
// let srcPtr := value
// let i := 0
-// for { } 1 { i := add(i, 1) }
+// for { } lt(i, 0x3) { i := add(i, 1) }
// {
-// if iszero(lt(i, 0x3)) { break }
// mstore(pos, and(mload(srcPtr), sub(shl(160, 1), 1)))
// srcPtr := add(srcPtr, 0x20)
// pos := add(pos, 0x20)
@@ -567,12 +561,12 @@
// }
// function array_allocation_size_t_array$_t_address_$dyn_memory(length) -> size
// {
-// if gt(length, 0xffffffffffffffff) { revert(0, 0) }
+// if gt(length, 0xffffffffffffffff) { revert(size, size) }
// size := add(mul(length, 0x20), 0x20)
// }
// function array_allocation_size_t_array$_t_uint256_$2_memory(length) -> size
// {
-// if gt(length, 0xffffffffffffffff) { revert(0, 0) }
+// if gt(length, 0xffffffffffffffff) { revert(size, size) }
// size := mul(length, 0x20)
// }
// }
diff --git a/test/libyul/yulOptimizerTests/fullSuite/aztec.yul b/test/libyul/yulOptimizerTests/fullSuite/aztec.yul
index 20662f53a..0b82de7e9 100644
--- a/test/libyul/yulOptimizerTests/fullSuite/aztec.yul
+++ b/test/libyul/yulOptimizerTests/fullSuite/aztec.yul
@@ -233,13 +233,14 @@
// ----
// {
// {
-// mstore(0x80, 7673901602397024137095011250362199966051872585513276903826533215767972925880)
+// let _1 := 0x80
+// mstore(_1, 7673901602397024137095011250362199966051872585513276903826533215767972925880)
// mstore(0xa0, 8489654445897228341090914135473290831551238522473825886865492707826370766375)
// let notes := add(0x04, calldataload(0x04))
// let m := calldataload(0x24)
// let n := calldataload(notes)
-// let _1 := 0x30644e72e131a029b85045b68181585d2833e84879b9709143e1f593f0000001
-// let challenge := mod(calldataload(0x44), _1)
+// let _2 := 0x30644e72e131a029b85045b68181585d2833e84879b9709143e1f593f0000001
+// let challenge := mod(calldataload(0x44), _2)
// if gt(m, n)
// {
// mstore(0x00, 404)
@@ -249,77 +250,75 @@
// mstore(0x2a0, caller())
// mstore(0x2c0, kn)
// mstore(0x2e0, m)
-// kn := mulmod(sub(_1, kn), challenge, _1)
+// kn := mulmod(sub(_2, kn), challenge, _2)
// hashCommitments(notes, n)
-// let b := add(0x300, mul(n, 0x80))
+// let b := add(0x300, mul(n, _1))
// let i := 0
-// let i_1 := i
-// for { } 1 { i := add(i, 0x01) }
+// for { } lt(i, n) { i := add(i, 0x01) }
// {
-// if iszero(lt(i, n)) { break }
-// let _2 := add(calldataload(0x04), mul(i, 0xc0))
-// let noteIndex := add(_2, 0x24)
-// let k := i_1
-// let a := calldataload(add(_2, 0x44))
+// let _3 := add(calldataload(0x04), mul(i, 0xc0))
+// let noteIndex := add(_3, 0x24)
+// let k := 0
+// let a := calldataload(add(_3, 0x44))
// let c := challenge
-// let _3 := add(i, 0x01)
-// switch eq(_3, n)
+// let _4 := add(i, 0x01)
+// switch eq(_4, n)
// case 1 {
// k := kn
-// if eq(m, n) { k := sub(_1, kn) }
+// if eq(m, n) { k := sub(_2, kn) }
// }
// case 0 { k := calldataload(noteIndex) }
// validateCommitment(noteIndex, k, a)
-// switch gt(_3, m)
+// switch gt(_4, m)
// case 1 {
-// kn := addmod(kn, sub(_1, k), _1)
-// let x := mod(mload(i_1), _1)
-// k := mulmod(k, x, _1)
-// a := mulmod(a, x, _1)
-// c := mulmod(challenge, x, _1)
-// mstore(i_1, keccak256(i_1, 0x20))
+// kn := addmod(kn, sub(_2, k), _2)
+// let x := mod(mload(0), _2)
+// k := mulmod(k, x, _2)
+// a := mulmod(a, x, _2)
+// c := mulmod(challenge, x, _2)
+// mstore(0, keccak256(0, 0x20))
// }
-// case 0 { kn := addmod(kn, k, _1) }
-// let _4 := 0x40
-// calldatacopy(0xe0, add(_2, 164), _4)
-// calldatacopy(0x20, add(_2, 100), _4)
-// mstore(0x120, sub(_1, c))
+// case 0 { kn := addmod(kn, k, _2) }
+// let _5 := 0x40
+// calldatacopy(0xe0, add(_3, 164), _5)
+// calldatacopy(0x20, add(_3, 100), _5)
+// mstore(0x120, sub(_2, c))
// mstore(0x60, k)
// mstore(0xc0, a)
-// let result := call(gas(), 7, i_1, 0xe0, 0x60, 0x1a0, _4)
-// let result_1 := and(result, call(gas(), 7, i_1, 0x20, 0x60, 0x120, _4))
-// let result_2 := and(result_1, call(gas(), 7, i_1, 0x80, 0x60, 0x160, _4))
-// let result_3 := and(result_2, call(gas(), 6, i_1, 0x120, 0x80, 0x160, _4))
-// result := and(result_3, call(gas(), 6, i_1, 0x160, 0x80, b, _4))
+// let result := call(gas(), 7, 0, 0xe0, 0x60, 0x1a0, _5)
+// let result_1 := and(result, call(gas(), 7, 0, 0x20, 0x60, 0x120, _5))
+// let result_2 := and(result_1, call(gas(), 7, 0, _1, 0x60, 0x160, _5))
+// let result_3 := and(result_2, call(gas(), 6, 0, 0x120, _1, 0x160, _5))
+// result := and(result_3, call(gas(), 6, 0, 0x160, _1, b, _5))
// if eq(i, m)
// {
// mstore(0x260, mload(0x20))
-// mstore(0x280, mload(_4))
+// mstore(0x280, mload(_5))
// mstore(0x1e0, mload(0xe0))
// mstore(0x200, sub(0x30644e72e131a029b85045b68181585d97816a916871ca8d3c208c16d87cfd47, mload(0x100)))
// }
// if gt(i, m)
// {
// mstore(0x60, c)
-// let result_4 := and(result, call(gas(), 7, i_1, 0x20, 0x60, 0x220, _4))
-// let result_5 := and(result_4, call(gas(), 6, i_1, 0x220, 0x80, 0x260, _4))
-// result := and(result_5, call(gas(), 6, i_1, 0x1a0, 0x80, 0x1e0, _4))
+// let result_4 := and(result, call(gas(), 7, 0, 0x20, 0x60, 0x220, _5))
+// let result_5 := and(result_4, call(gas(), 6, 0, 0x220, _1, 0x260, _5))
+// result := and(result_5, call(gas(), 6, 0, 0x1a0, _1, 0x1e0, _5))
// }
// if iszero(result)
// {
-// mstore(i_1, 400)
-// revert(i_1, 0x20)
+// mstore(0, 400)
+// revert(0, 0x20)
// }
-// b := add(b, _4)
+// b := add(b, _5)
// }
// if lt(m, n) { validatePairing(0x64) }
-// if iszero(eq(mod(keccak256(0x2a0, add(b, not(671))), _1), challenge))
+// if iszero(eq(mod(keccak256(0x2a0, add(b, not(671))), _2), challenge))
// {
-// mstore(i_1, 404)
-// revert(i_1, 0x20)
+// mstore(0, 404)
+// revert(0, 0x20)
// }
-// mstore(i_1, 0x01)
-// return(i_1, 0x20)
+// mstore(0, 0x01)
+// return(0, 0x20)
// }
// function validatePairing(t2)
// {
@@ -374,9 +373,8 @@
// function hashCommitments(notes, n)
// {
// let i := 0
-// for { } 1 { i := add(i, 0x01) }
+// for { } lt(i, n) { i := add(i, 0x01) }
// {
-// if iszero(lt(i, n)) { break }
// calldatacopy(add(0x300, mul(i, 0x80)), add(add(notes, mul(i, 0xc0)), 0x60), 0x80)
// }
// mstore(0, keccak256(0x300, mul(n, 0x80)))
diff --git a/test/libyul/yulOptimizerTests/fullSuite/ssaReverse.yul b/test/libyul/yulOptimizerTests/fullSuite/ssaReverse.yul
index 25e279f67..c4a70b03e 100644
--- a/test/libyul/yulOptimizerTests/fullSuite/ssaReverse.yul
+++ b/test/libyul/yulOptimizerTests/fullSuite/ssaReverse.yul
@@ -47,9 +47,9 @@
// }
// function abi_decode_t_bytes_calldata_ptr(offset, end) -> arrayPos, length
// {
-// if iszero(slt(add(offset, 0x1f), end)) { revert(0, 0) }
+// if iszero(slt(add(offset, 0x1f), end)) { revert(arrayPos, arrayPos) }
// length := calldataload(offset)
-// if gt(length, 0xffffffffffffffff) { revert(0, 0) }
+// if gt(length, 0xffffffffffffffff) { revert(arrayPos, arrayPos) }
// arrayPos := add(offset, 0x20)
// if gt(add(add(offset, length), 0x20), end) { revert(0, 0) }
// }
diff --git a/test/tools/yulopti.cpp b/test/tools/yulopti.cpp
index e916e8206..d84f8b6d1 100644
--- a/test/tools/yulopti.cpp
+++ b/test/tools/yulopti.cpp
@@ -43,6 +43,7 @@
#include
#include
#include
+#include
#include
#include
#include
@@ -134,8 +135,8 @@ public:
}
cout << "(q)quit/(f)flatten/(c)se/initialize var(d)ecls/(x)plit/(j)oin/(g)rouper/(h)oister/" << endl;
cout << " (e)xpr inline/(i)nline/(s)implify/varname c(l)eaner/(u)nusedprune/ss(a) transform/" << endl;
- cout << " (r)edundant assign elim./re(m)aterializer/f(o)r-loop-init-rewriter/f(O)r-loop-condition-into-body/" << endl;
- cout << " s(t)ructural simplifier/equi(v)alent function combiner/ssa re(V)erser/? " << endl;
+ cout << " (r)edundant assign elim./re(m)aterializer/f(o)r-loop-init-rewriter/for-loop-condition-(I)nto-body/" << endl;
+ cout << " for-loop-condition-(O)ut-of-body/s(t)ructural simplifier/equi(v)alent function combiner/ssa re(V)erser/" << endl;
cout << " co(n)trol flow simplifier/stack com(p)ressor/(D)ead code eliminator/(L)oad resolver/? " << endl;
cout.flush();
int option = readStandardInputChar();
@@ -151,6 +152,9 @@ public:
ForLoopInitRewriter{}(*m_ast);
break;
case 'O':
+ ForLoopConditionOutOfBody{m_dialect}(*m_ast);
+ break;
+ case 'I':
ForLoopConditionIntoBody{m_dialect}(*m_ast);
break;
case 'c':