From 0532a8cef2925cd22e26ddeea2be2d34903f4538 Mon Sep 17 00:00:00 2001 From: chriseth Date: Wed, 8 May 2019 12:41:19 +0200 Subject: [PATCH] Format short blocks and loops on a single line. --- libyul/AsmPrinter.cpp | 39 +++++--- .../output.json | 2 +- .../standard_yul_object_name/output.json | 2 +- .../standard_yul_optimized/output.json | 2 +- test/libsolidity/InlineAssembly.cpp | 27 +++--- test/libyul/ObjectParser.cpp | 8 +- .../blockFlattener/for_stmt.yul | 12 +-- .../branches_for.yul | 7 +- .../branches_if.yul | 5 +- .../commonSubexpressionEliminator/smoke.yul | 3 +- .../deadCodeEliminator/conditional_break.yul | 12 +-- .../deadCodeEliminator/early_break.yul | 7 +- .../deadCodeEliminator/early_continue.yul | 7 +- .../deadCodeEliminator/for_loop_init_decl.yul | 4 +- .../function_after_revert.yul | 4 +- .../deadCodeEliminator/nested_revert.yul | 8 +- .../deadCodeEliminator/no_removal.yul | 4 +- .../deadCodeEliminator/normal_break.yul | 7 +- .../deadCodeEliminator/normal_continue.yul | 7 +- .../deadCodeEliminator/normal_stop.yul | 7 +- .../disambiguator/for_statement.yul | 16 +--- .../disambiguator/if_statement.yul | 9 +- .../yulOptimizerTests/disambiguator/smoke.yul | 3 +- .../disambiguator/smoke_yul.yul | 3 +- .../disambiguator/switch_statement.yul | 12 +-- .../disambiguator/variables.yul | 8 +- .../disambiguator/variables_clash.yul | 4 +- .../variables_inside_functions.yul | 4 +- .../multiple_complex.yul | 42 ++------ .../equivalentFunctionCombiner/simple.yul | 8 +- .../switch_case_order.yul | 16 +--- .../expressionInliner/complex_with_evm.yul | 4 +- .../expressionInliner/double_calls.yul | 8 +- .../double_recursive_calls.yul | 4 +- .../expressionInliner/no_inline_mload.yul | 4 +- .../no_move_with_sideeffects.yul | 4 +- .../expressionInliner/simple.yul | 4 +- .../expressionInliner/with_args.yul | 4 +- .../expressionJoiner/if_condition.yul | 5 +- .../no_replacement_in_loop_condition1.yul | 10 +- .../no_replacement_in_loop_condition2.yul | 9 +- .../expressionJoiner/smoke.yul | 3 +- .../expressionJoiner/switch_expression.yul | 8 +- .../assigned_vars_multi.yul | 3 +- .../constant_propagation.yul | 4 +- .../expressionSimplifier/constants.yul | 4 +- .../identity_rules_complex.yul | 4 +- .../including_function_calls.yul | 3 +- .../expressionSimplifier/inside_for.yul | 10 +- ...lied_function_call_different_arguments.yul | 3 +- ..._applied_function_call_different_names.yul | 6 +- ...ied_function_call_equality_not_movable.yul | 3 +- .../expressionSimplifier/return_vars_zero.yul | 4 +- .../expressionSimplifier/reversed.yul | 4 +- .../expressionSimplifier/smoke.yul | 3 +- .../expressionSplitter/control_flow.yul | 6 +- .../expressionSplitter/smoke.yul | 3 +- .../forLoopInitRewriter/complex_pre.yul | 11 +-- .../forLoopInitRewriter/empty_pre.yul | 11 +-- .../forLoopInitRewriter/nested.yul | 28 ++---- .../forLoopInitRewriter/simple.yul | 11 +-- .../fullInliner/inside_condition.yul | 5 +- .../fullInliner/multi_fun.yul | 4 +- .../fullInliner/multi_fun_callback.yul | 4 +- .../no_inline_into_big_function.yul | 4 +- .../no_inline_into_big_global_context.yul | 4 +- .../fullInliner/no_return.yul | 4 +- .../fullInliner/not_inside_for.yul | 3 +- .../fullInliner/recursion.yul | 4 +- .../fullSimplify/constants.yul | 4 +- .../fullSimplify/identity_rules_complex.yul | 4 +- .../fullSimplify/including_function_calls.yul | 3 +- .../fullSimplify/inside_for.yul | 10 +- ...lied_function_call_different_arguments.yul | 3 +- ..._applied_function_call_different_names.yul | 6 +- ...ied_function_call_equality_not_movable.yul | 3 +- .../yulOptimizerTests/fullSimplify/smoke.yul | 3 +- .../yulOptimizerTests/fullSuite/abi2.yul | 40 ++------ .../fullSuite/abi_example1.yul | 95 ++++--------------- .../yulOptimizerTests/fullSuite/aztec.yul | 28 +----- .../reuse_vars_bug_in_simplifier.yul | 6 +- .../fullSuite/ssaReverse.yul | 15 +-- .../fullSuite/switch_inline.yul | 6 +- .../fullSuite/switch_inline_match_default.yul | 6 +- .../functionGrouper/already_grouped.yul | 8 +- .../functionGrouper/empty_block.yul | 15 +-- .../grouped_but_not_ordered.yul | 10 +- .../functionGrouper/multi_fun_mixed.yul | 8 +- .../functionGrouper/nested_fun.yul | 8 +- .../functionGrouper/single_fun.yul | 7 +- .../functionGrouper/smoke.yul | 5 +- .../functionHoister/empty_block.yul | 9 +- .../functionHoister/multi_mixed.yul | 8 +- .../functionHoister/nested.yul | 4 +- .../functionHoister/single.yul | 3 +- .../functionHoister/smoke.yul | 3 +- .../mainFunction/empty_block.yul | 15 +-- .../mainFunction/multi_fun_mixed.yul | 8 +- .../mainFunction/nested_fun.yul | 8 +- .../mainFunction/sigle_fun.yul | 7 +- .../yulOptimizerTests/mainFunction/smoke.yul | 3 +- .../redundantAssignEliminator/for.yul | 11 +-- .../redundantAssignEliminator/for_branch.yul | 10 +- .../redundantAssignEliminator/for_break.yul | 6 +- .../for_continue.yul | 11 +-- .../for_continue_2.yul | 6 +- .../for_continue_3.yul | 7 +- .../for_decl_inside_break_continue.yul | 16 +--- .../for_deep_noremove.yul | 43 ++------- .../for_deep_simple.yul | 47 ++------- .../for_multi_break.yul | 3 +- .../redundantAssignEliminator/for_nested.yul | 12 +-- .../redundantAssignEliminator/for_rerun.yul | 6 +- .../for_stmnts_after_break_continue.yul | 6 +- .../redundantAssignEliminator/if.yul | 5 +- .../if_overwrite_all_branches.yul | 4 +- .../if_used_in_one_branch.yul | 4 +- .../multi_assign.yul | 3 +- .../redundantAssignEliminator/scopes.yul | 4 +- .../redundantAssignEliminator/simple.yul | 4 +- .../switch_overwrite_in_all.yul | 8 +- .../switch_overwrite_in_one.yul | 4 +- .../switch_overwrite_use_combination.yul | 8 +- .../switch_unused.yul | 4 +- .../rematerialiser/branches_for1.yul | 11 +-- .../rematerialiser/branches_for2.yul | 7 +- .../rematerialiser/branches_switch.yul | 4 +- .../rematerialiser/for_break.yul | 12 +-- .../rematerialiser/for_continue.yul | 12 +-- .../rematerialiser/for_continue_2.yul | 17 +--- .../for_continue_with_assignment_in_post.yul | 8 +- .../rematerialiser/non_movable_function.yul | 3 +- .../rematerialiser/reassignment.yul | 5 +- .../rematerialiser/smoke.yul | 3 +- .../splitJoin/control_flow.yul | 8 +- .../yulOptimizerTests/splitJoin/functions.yul | 8 +- .../yulOptimizerTests/splitJoin/smoke.yul | 3 +- .../yulOptimizerTests/ssaAndBack/for_loop.yul | 7 +- .../ssaAndBack/single_assign_if.yul | 5 +- .../ssaAndBack/single_assign_switch.yul | 8 +- .../ssaAndBack/ssaReverse.yul | 5 +- .../ssaPlusCleanup/control_structures.yul | 3 +- .../ssaReverser/abi_example.yul | 15 +-- .../ssaTransform/for_reassign_body.yul | 8 +- .../ssaTransform/for_reassign_init.yul | 8 +- .../ssaTransform/for_reassign_post.yul | 8 +- .../ssaTransform/multi_assign.yul | 3 +- .../ssaTransform/multi_decl.yul | 3 +- .../stackCompressor/noInline.yul | 4 +- .../bugfix_visit_after_change.yul | 4 +- .../empty_if_non_movable_condition.yul | 4 +- .../for_false_condition.sol | 4 +- .../if_false_condition.yul | 3 +- .../if_multi_unassigned_condition.yul | 4 +- .../if_true_condition.yul | 4 +- .../if_unassigned_condition.yul | 4 +- .../structuralSimplifier/nested.yul | 4 +- .../structuralSimplifier/switch_inline.yul | 4 +- .../switch_inline_match_default.yul | 4 +- .../switch_inline_no_match.yul | 4 +- .../switch_inline_no_match_mixed.yul | 4 +- .../switch_no_remove_empty_case.yul | 11 +-- .../switch_only_default.yul | 4 +- .../switch_remove_empty_case.yul | 8 +- .../switch_remove_empty_cases.yul | 5 +- .../switch_remove_empty_default_case.yul | 8 +- .../structuralSimplifier/switch_to_if.yul | 5 +- .../unusedPruner/functions.yul | 3 +- .../intermediate_multi_assignment.yul | 3 +- .../unusedPruner/multi_assign.yul | 3 +- .../unusedPruner/multi_declarations.yul | 3 +- .../unusedPruner/multi_declare.yul | 3 +- .../yulOptimizerTests/unusedPruner/pop.yul | 3 +- .../yulOptimizerTests/unusedPruner/smoke.yul | 3 +- .../unusedPruner/trivial.yul | 4 +- .../varDeclInitializer/simple.yul | 4 +- .../varNameCleaner/builtins.yul | 4 +- .../varNameCleaner/function_names.yul | 4 +- .../varNameCleaner/function_scopes.yul | 8 +- .../varNameCleaner/instructions.yul | 4 +- 180 files changed, 338 insertions(+), 1089 deletions(-) diff --git a/libyul/AsmPrinter.cpp b/libyul/AsmPrinter.cpp index a7a819440..a3d9eafc3 100644 --- a/libyul/AsmPrinter.cpp +++ b/libyul/AsmPrinter.cpp @@ -191,7 +191,11 @@ string AsmPrinter::operator()(FunctionCall const& _functionCall) const string AsmPrinter::operator()(If const& _if) const { solAssert(_if.condition, "Invalid if condition."); - return "if " + boost::apply_visitor(*this, *_if.condition) + "\n" + (*this)(_if.body); + string body = (*this)(_if.body); + char delim = '\n'; + if (body.find('\n') == string::npos) + delim = ' '; + return "if " + boost::apply_visitor(*this, *_if.condition) + delim + (*this)(_if.body); } string AsmPrinter::operator()(Switch const& _switch) const @@ -212,15 +216,19 @@ string AsmPrinter::operator()(Switch const& _switch) const string AsmPrinter::operator()(ForLoop const& _forLoop) const { solAssert(_forLoop.condition, "Invalid for loop condition."); - string out = "for "; - out += (*this)(_forLoop.pre); - out += "\n"; - out += boost::apply_visitor(*this, *_forLoop.condition); - out += "\n"; - out += (*this)(_forLoop.post); - out += "\n"; - out += (*this)(_forLoop.body); - return out; + string pre = (*this)(_forLoop.pre); + string condition = boost::apply_visitor(*this, *_forLoop.condition); + string post = (*this)(_forLoop.post); + char delim = '\n'; + if ( + pre.size() + condition.size() + post.size() < 60 && + pre.find('\n') == string::npos && + post.find('\n') == string::npos + ) + delim = ' '; + return + ("for " + move(pre) + delim + move(condition) + delim + move(post) + "\n") + + (*this)(_forLoop.body); } string AsmPrinter::operator()(Break const&) const @@ -236,13 +244,18 @@ string AsmPrinter::operator()(Continue const&) const string AsmPrinter::operator()(Block const& _block) const { if (_block.statements.empty()) - return "{\n}"; + return "{ }"; string body = boost::algorithm::join( _block.statements | boost::adaptors::transformed(boost::apply_visitor(*this)), "\n" ); - boost::replace_all(body, "\n", "\n "); - return "{\n " + body + "\n}"; + if (body.size() < 30 && body.find('\n') == string::npos) + return "{ " + body + " }"; + else + { + boost::replace_all(body, "\n", "\n "); + return "{\n " + body + "\n}"; + } } string AsmPrinter::formatTypedName(TypedName _variable) const diff --git a/test/cmdlineTests/standard_irOptimized_requested/output.json b/test/cmdlineTests/standard_irOptimized_requested/output.json index 99e13e010..d103202e9 100644 --- a/test/cmdlineTests/standard_irOptimized_requested/output.json +++ b/test/cmdlineTests/standard_irOptimized_requested/output.json @@ -1 +1 @@ -{"contracts":{"A":{"C":{"irOptimized":"/*******************************************************\n * WARNING *\n * Solidity to Yul compilation is still EXPERIMENTAL *\n * It can result in LOSS OF FUNDS or worse *\n * !USE AT YOUR OWN RISK! *\n *******************************************************/\n\nobject \"C_6\" {\n code {\n mstore(64, 128)\n codecopy(0, dataoffset(\"C_6_deployed\"), datasize(\"C_6_deployed\"))\n return(0, datasize(\"C_6_deployed\"))\n }\n object \"C_6_deployed\" {\n code {\n mstore(64, 128)\n if iszero(lt(calldatasize(), 4))\n {\n let selector := shift_right_224_unsigned(calldataload(0))\n switch selector\n case 0x26121ff0 {\n if callvalue()\n {\n revert(0, 0)\n }\n abi_decode_tuple_(4, calldatasize())\n fun_f_5()\n let memPos := allocateMemory(0)\n let memEnd := abi_encode_tuple__to__fromStack(memPos)\n return(memPos, sub(memEnd, memPos))\n }\n default {\n }\n }\n revert(0, 0)\n function abi_decode_tuple_(headStart, dataEnd)\n {\n if slt(sub(dataEnd, headStart), 0)\n {\n revert(0, 0)\n }\n }\n function abi_encode_tuple__to__fromStack(headStart) -> tail\n {\n tail := add(headStart, 0)\n }\n function allocateMemory(size) -> memPtr\n {\n memPtr := mload(64)\n let newFreePtr := add(memPtr, size)\n if or(gt(newFreePtr, 0xffffffffffffffff), lt(newFreePtr, memPtr))\n {\n revert(0, 0)\n }\n mstore(64, newFreePtr)\n }\n function fun_f_5()\n {\n for {\n let return_flag := 1\n }\n return_flag\n {\n }\n {\n break\n }\n }\n function shift_right_224_unsigned(value) -> newValue\n {\n newValue := shr(224, value)\n }\n }\n }\n}\n"}}},"sources":{"A":{"id":0}}} +{"contracts":{"A":{"C":{"irOptimized":"/*******************************************************\n * WARNING *\n * Solidity to Yul compilation is still EXPERIMENTAL *\n * It can result in LOSS OF FUNDS or worse *\n * !USE AT YOUR OWN RISK! *\n *******************************************************/\n\nobject \"C_6\" {\n code {\n mstore(64, 128)\n codecopy(0, dataoffset(\"C_6_deployed\"), datasize(\"C_6_deployed\"))\n return(0, datasize(\"C_6_deployed\"))\n }\n object \"C_6_deployed\" {\n code {\n mstore(64, 128)\n if iszero(lt(calldatasize(), 4))\n {\n let selector := shift_right_224_unsigned(calldataload(0))\n switch selector\n case 0x26121ff0 {\n if callvalue() { revert(0, 0) }\n abi_decode_tuple_(4, calldatasize())\n fun_f_5()\n let memPos := allocateMemory(0)\n let memEnd := abi_encode_tuple__to__fromStack(memPos)\n return(memPos, sub(memEnd, memPos))\n }\n default { }\n }\n revert(0, 0)\n function abi_decode_tuple_(headStart, dataEnd)\n {\n if slt(sub(dataEnd, headStart), 0) { revert(0, 0) }\n }\n function abi_encode_tuple__to__fromStack(headStart) -> tail\n { tail := add(headStart, 0) }\n function allocateMemory(size) -> memPtr\n {\n memPtr := mload(64)\n let newFreePtr := add(memPtr, size)\n if or(gt(newFreePtr, 0xffffffffffffffff), lt(newFreePtr, memPtr)) { revert(0, 0) }\n mstore(64, newFreePtr)\n }\n function fun_f_5()\n {\n for { let return_flag := 1 } return_flag { }\n { break }\n }\n function shift_right_224_unsigned(value) -> newValue\n { newValue := shr(224, value) }\n }\n }\n}\n"}}},"sources":{"A":{"id":0}}} diff --git a/test/cmdlineTests/standard_yul_object_name/output.json b/test/cmdlineTests/standard_yul_object_name/output.json index 16644297f..9c8821d2b 100644 --- a/test/cmdlineTests/standard_yul_object_name/output.json +++ b/test/cmdlineTests/standard_yul_object_name/output.json @@ -1 +1 @@ -{"contracts":{"A":{"NamedObject":{"evm":{"assembly":" data_4e03657aea45a94fc7d47ba826c8d667c0d1e6e33a64a036ec44f58fa12d6c45\n /* \"A\":80:81 */\n 0x00\n /* \"A\":76:77 */\n 0x00\n /* \"A\":73:74 */\n dup3\n /* \"A\":69:78 */\n add\n /* \"A\":62:82 */\n sstore\n /* \"A\":28:84 */\n pop\nstop\ndata_4e03657aea45a94fc7d47ba826c8d667c0d1e6e33a64a036ec44f58fa12d6c45 616263\n\nsub_0: assembly {\n /* \"A\":147:148 */\n 0x00\n /* \"A\":144:145 */\n 0x00\n /* \"A\":137:149 */\n revert\n}\n","bytecode":{"linkReferences":{},"object":"600b6000600082015550fe616263","opcodes":"PUSH1 0xB PUSH1 0x0 PUSH1 0x0 DUP3 ADD SSTORE POP INVALID PUSH2 0x6263 ","sourceMap":""}},"ir":"object \"NamedObject\" {\n code {\n let x := dataoffset(\"DataName\")\n sstore(add(x, 0), 0)\n }\n data \"DataName\" hex\"616263\"\n object \"OtherObject\" {\n code {\n revert(0, 0)\n }\n }\n}\n","irOptimized":"object \"NamedObject\" {\n code {\n let x := dataoffset(\"DataName\")\n sstore(add(x, 0), 0)\n }\n data \"DataName\" hex\"616263\"\n object \"OtherObject\" {\n code {\n revert(0, 0)\n }\n }\n}\n"}}},"errors":[{"component":"general","formattedMessage":"Yul is still experimental. Please use the output with care.","message":"Yul is still experimental. Please use the output with care.","severity":"warning","type":"Warning"}]} +{"contracts":{"A":{"NamedObject":{"evm":{"assembly":" data_4e03657aea45a94fc7d47ba826c8d667c0d1e6e33a64a036ec44f58fa12d6c45\n /* \"A\":80:81 */\n 0x00\n /* \"A\":76:77 */\n 0x00\n /* \"A\":73:74 */\n dup3\n /* \"A\":69:78 */\n add\n /* \"A\":62:82 */\n sstore\n /* \"A\":28:84 */\n pop\nstop\ndata_4e03657aea45a94fc7d47ba826c8d667c0d1e6e33a64a036ec44f58fa12d6c45 616263\n\nsub_0: assembly {\n /* \"A\":147:148 */\n 0x00\n /* \"A\":144:145 */\n 0x00\n /* \"A\":137:149 */\n revert\n}\n","bytecode":{"linkReferences":{},"object":"600b6000600082015550fe616263","opcodes":"PUSH1 0xB PUSH1 0x0 PUSH1 0x0 DUP3 ADD SSTORE POP INVALID PUSH2 0x6263 ","sourceMap":""}},"ir":"object \"NamedObject\" {\n code {\n let x := dataoffset(\"DataName\")\n sstore(add(x, 0), 0)\n }\n data \"DataName\" hex\"616263\"\n object \"OtherObject\" {\n code { revert(0, 0) }\n }\n}\n","irOptimized":"object \"NamedObject\" {\n code {\n let x := dataoffset(\"DataName\")\n sstore(add(x, 0), 0)\n }\n data \"DataName\" hex\"616263\"\n object \"OtherObject\" {\n code { revert(0, 0) }\n }\n}\n"}}},"errors":[{"component":"general","formattedMessage":"Yul is still experimental. Please use the output with care.","message":"Yul is still experimental. Please use the output with care.","severity":"warning","type":"Warning"}]} diff --git a/test/cmdlineTests/standard_yul_optimized/output.json b/test/cmdlineTests/standard_yul_optimized/output.json index fe4992a9f..1f93036bc 100644 --- a/test/cmdlineTests/standard_yul_optimized/output.json +++ b/test/cmdlineTests/standard_yul_optimized/output.json @@ -1 +1 @@ -{"contracts":{"A":{"object":{"evm":{"assembly":" /* \"A\":17:18 */\n 0x00\n 0x00\n /* \"A\":11:19 */\n mload\n /* \"A\":20:40 */\n sstore\n","bytecode":{"linkReferences":{},"object":"600060005155","opcodes":"PUSH1 0x0 PUSH1 0x0 MLOAD SSTORE ","sourceMap":""}},"ir":"object \"object\" {\n code {\n let x := mload(0)\n sstore(add(x, 0), 0)\n }\n}\n","irOptimized":"object \"object\" {\n code {\n {\n sstore(mload(0), 0)\n }\n }\n}\n"}}},"errors":[{"component":"general","formattedMessage":"Yul is still experimental. Please use the output with care.","message":"Yul is still experimental. Please use the output with care.","severity":"warning","type":"Warning"}]} +{"contracts":{"A":{"object":{"evm":{"assembly":" /* \"A\":17:18 */\n 0x00\n 0x00\n /* \"A\":11:19 */\n mload\n /* \"A\":20:40 */\n sstore\n","bytecode":{"linkReferences":{},"object":"600060005155","opcodes":"PUSH1 0x0 PUSH1 0x0 MLOAD SSTORE ","sourceMap":""}},"ir":"object \"object\" {\n code {\n let x := mload(0)\n sstore(add(x, 0), 0)\n }\n}\n","irOptimized":"object \"object\" {\n code { { sstore(mload(0), 0) } }\n}\n"}}},"errors":[{"component":"general","formattedMessage":"Yul is still experimental. Please use the output with care.","message":"Yul is still experimental. Please use the output with care.","severity":"warning","type":"Warning"}]} diff --git a/test/libsolidity/InlineAssembly.cpp b/test/libsolidity/InlineAssembly.cpp index 0479be2f3..809a72636 100644 --- a/test/libsolidity/InlineAssembly.cpp +++ b/test/libsolidity/InlineAssembly.cpp @@ -555,7 +555,7 @@ BOOST_AUTO_TEST_SUITE(Printing) BOOST_AUTO_TEST_CASE(print_smoke) { - parsePrintCompare("{\n}"); + parsePrintCompare("{ }"); } BOOST_AUTO_TEST_CASE(print_instructions) @@ -570,7 +570,7 @@ BOOST_AUTO_TEST_CASE(print_subblock) BOOST_AUTO_TEST_CASE(print_functional) { - parsePrintCompare("{\n let x := mul(sload(0x12), 7)\n}"); + parsePrintCompare("{ let x := mul(sload(0x12), 7) }"); } BOOST_AUTO_TEST_CASE(print_label) @@ -585,7 +585,7 @@ BOOST_AUTO_TEST_CASE(print_assignments) BOOST_AUTO_TEST_CASE(print_multi_assignments) { - parsePrintCompare("{\n function f() -> x, y\n {\n }\n let x, y := f()\n}"); + parsePrintCompare("{\n function f() -> x, y\n { }\n let x, y := f()\n}"); } BOOST_AUTO_TEST_CASE(print_string_literals) @@ -596,48 +596,45 @@ BOOST_AUTO_TEST_CASE(print_string_literals) BOOST_AUTO_TEST_CASE(print_string_literal_unicode) { string source = "{ let x := \"\\u1bac\" }"; - string parsed = "object \"object\" {\n code {\n let x := \"\\xe1\\xae\\xac\"\n }\n}\n"; + string parsed = "object \"object\" {\n code { let x := \"\\xe1\\xae\\xac\" }\n}\n"; AssemblyStack stack(dev::test::Options::get().evmVersion(), AssemblyStack::Language::Assembly, OptimiserSettings::none()); BOOST_REQUIRE(stack.parseAndAnalyze("", source)); BOOST_REQUIRE(stack.errors().empty()); BOOST_CHECK_EQUAL(stack.print(), parsed); - string parsedInner = "{\n let x := \"\\xe1\\xae\\xac\"\n}"; + string parsedInner = "{ let x := \"\\xe1\\xae\\xac\" }"; parsePrintCompare(parsedInner); } BOOST_AUTO_TEST_CASE(print_if) { - parsePrintCompare("{\n if 2\n {\n pop(mload(0))\n }\n}"); + parsePrintCompare("{ if 2 { pop(mload(0)) } }"); } BOOST_AUTO_TEST_CASE(print_switch) { - parsePrintCompare("{\n switch 42\n case 1 {\n }\n case 2 {\n }\n default {\n }\n}"); + parsePrintCompare("{\n switch 42\n case 1 { }\n case 2 { }\n default { }\n}"); } BOOST_AUTO_TEST_CASE(print_for) { - parsePrintCompare("{\n let ret := 5\n for {\n let i := 1\n }\n lt(i, 15)\n {\n i := add(i, 1)\n }\n {\n ret := mul(ret, i)\n }\n}"); + parsePrintCompare("{\n let ret := 5\n for { let i := 1 } lt(i, 15) { i := add(i, 1) }\n { ret := mul(ret, i) }\n}"); } BOOST_AUTO_TEST_CASE(function_definitions_multiple_args) { - parsePrintCompare("{\n function f(a, d)\n {\n mstore(a, d)\n }\n function g(a, d) -> x, y\n {\n }\n}"); + parsePrintCompare("{\n function f(a, d)\n { mstore(a, d) }\n function g(a, d) -> x, y\n { }\n}"); } BOOST_AUTO_TEST_CASE(function_calls) { string source = R"({ function y() - { - } + { } function f(a) -> b - { - } + { } function g(a, b, c) - { - } + { } g(1, mul(2, address()), f(mul(2, caller()))) y() })"; diff --git a/test/libyul/ObjectParser.cpp b/test/libyul/ObjectParser.cpp index c54cee762..f60582823 100644 --- a/test/libyul/ObjectParser.cpp +++ b/test/libyul/ObjectParser.cpp @@ -228,14 +228,10 @@ BOOST_AUTO_TEST_CASE(to_string) string expectation = R"(object "O" { code { let x := mload(0) - if x - { - sstore(0, 1) - } + if x { sstore(0, 1) } } object "i" { - code { - } + code { } data "j" hex"646566" } data "j" hex"616263" diff --git a/test/libyul/yulOptimizerTests/blockFlattener/for_stmt.yul b/test/libyul/yulOptimizerTests/blockFlattener/for_stmt.yul index 83f9832e9..dfb88a178 100644 --- a/test/libyul/yulOptimizerTests/blockFlattener/for_stmt.yul +++ b/test/libyul/yulOptimizerTests/blockFlattener/for_stmt.yul @@ -7,14 +7,6 @@ // step: blockFlattener // ---- // { -// for { -// let a := 1 -// } -// iszero(eq(a, 10)) -// { -// a := add(a, 1) -// } -// { -// a := add(a, 1) -// } +// for { let a := 1 } iszero(eq(a, 10)) { a := add(a, 1) } +// { a := add(a, 1) } // } diff --git a/test/libyul/yulOptimizerTests/commonSubexpressionEliminator/branches_for.yul b/test/libyul/yulOptimizerTests/commonSubexpressionEliminator/branches_for.yul index 721f78add..a077efcf1 100644 --- a/test/libyul/yulOptimizerTests/commonSubexpressionEliminator/branches_for.yul +++ b/test/libyul/yulOptimizerTests/commonSubexpressionEliminator/branches_for.yul @@ -12,15 +12,12 @@ // { // let a := 1 // let b := codesize() -// for { -// } +// for { } // lt(1, b) // { // mstore(1, b) // a := add(a, b) // } -// { -// mstore(1, b) -// } +// { mstore(1, b) } // mstore(1, b) // } diff --git a/test/libyul/yulOptimizerTests/commonSubexpressionEliminator/branches_if.yul b/test/libyul/yulOptimizerTests/commonSubexpressionEliminator/branches_if.yul index 0fd259b86..e664aa781 100644 --- a/test/libyul/yulOptimizerTests/commonSubexpressionEliminator/branches_if.yul +++ b/test/libyul/yulOptimizerTests/commonSubexpressionEliminator/branches_if.yul @@ -8,9 +8,6 @@ // ---- // { // let b := 1 -// if b -// { -// b := b -// } +// if b { b := b } // let c := 1 // } diff --git a/test/libyul/yulOptimizerTests/commonSubexpressionEliminator/smoke.yul b/test/libyul/yulOptimizerTests/commonSubexpressionEliminator/smoke.yul index 6ecbe105c..2457b3b56 100644 --- a/test/libyul/yulOptimizerTests/commonSubexpressionEliminator/smoke.yul +++ b/test/libyul/yulOptimizerTests/commonSubexpressionEliminator/smoke.yul @@ -2,5 +2,4 @@ // ==== // step: commonSubexpressionEliminator // ---- -// { -// } +// { } diff --git a/test/libyul/yulOptimizerTests/deadCodeEliminator/conditional_break.yul b/test/libyul/yulOptimizerTests/deadCodeEliminator/conditional_break.yul index ca36109ea..3d350c43b 100644 --- a/test/libyul/yulOptimizerTests/deadCodeEliminator/conditional_break.yul +++ b/test/libyul/yulOptimizerTests/deadCodeEliminator/conditional_break.yul @@ -18,17 +18,9 @@ // ---- // { // let a := 20 -// for { -// } -// lt(a, 40) -// { -// a := add(a, 2) -// } +// for { } lt(a, 40) { a := add(a, 2) } // { // a := a -// if lt(a, 0) -// { -// break -// } +// if lt(a, 0) { break } // } // } diff --git a/test/libyul/yulOptimizerTests/deadCodeEliminator/early_break.yul b/test/libyul/yulOptimizerTests/deadCodeEliminator/early_break.yul index 9d08c02ea..a0d751938 100644 --- a/test/libyul/yulOptimizerTests/deadCodeEliminator/early_break.yul +++ b/test/libyul/yulOptimizerTests/deadCodeEliminator/early_break.yul @@ -19,12 +19,7 @@ // ---- // { // let a := 20 -// for { -// } -// lt(a, 40) -// { -// a := add(a, 2) -// } +// for { } lt(a, 40) { a := add(a, 2) } // { // a := a // break diff --git a/test/libyul/yulOptimizerTests/deadCodeEliminator/early_continue.yul b/test/libyul/yulOptimizerTests/deadCodeEliminator/early_continue.yul index dee962c7c..61eae9ff2 100644 --- a/test/libyul/yulOptimizerTests/deadCodeEliminator/early_continue.yul +++ b/test/libyul/yulOptimizerTests/deadCodeEliminator/early_continue.yul @@ -19,12 +19,7 @@ // ---- // { // let a := 20 -// for { -// } -// lt(a, 40) -// { -// a := add(a, 2) -// } +// for { } lt(a, 40) { a := add(a, 2) } // { // a := a // continue diff --git a/test/libyul/yulOptimizerTests/deadCodeEliminator/for_loop_init_decl.yul b/test/libyul/yulOptimizerTests/deadCodeEliminator/for_loop_init_decl.yul index 30753c9ad..295a49504 100644 --- a/test/libyul/yulOptimizerTests/deadCodeEliminator/for_loop_init_decl.yul +++ b/test/libyul/yulOptimizerTests/deadCodeEliminator/for_loop_init_decl.yul @@ -7,6 +7,4 @@ // ==== // step: deadCodeEliminator // ---- -// { -// stop() -// } +// { stop() } diff --git a/test/libyul/yulOptimizerTests/deadCodeEliminator/function_after_revert.yul b/test/libyul/yulOptimizerTests/deadCodeEliminator/function_after_revert.yul index 4821a985b..e1d0f30fe 100644 --- a/test/libyul/yulOptimizerTests/deadCodeEliminator/function_after_revert.yul +++ b/test/libyul/yulOptimizerTests/deadCodeEliminator/function_after_revert.yul @@ -19,7 +19,5 @@ // fun() // revert(0, 0) // function fun() -// { -// return(1, 1) -// } +// { return(1, 1) } // } diff --git a/test/libyul/yulOptimizerTests/deadCodeEliminator/nested_revert.yul b/test/libyul/yulOptimizerTests/deadCodeEliminator/nested_revert.yul index 625b468ce..b89c1e0b7 100644 --- a/test/libyul/yulOptimizerTests/deadCodeEliminator/nested_revert.yul +++ b/test/libyul/yulOptimizerTests/deadCodeEliminator/nested_revert.yul @@ -18,14 +18,10 @@ // { // let y := mload(0) // switch y -// case 0 { -// y := 8 -// } +// case 0 { y := 8 } // case 1 { // y := 9 // revert(0, 0) // } -// default { -// y := 10 -// } +// default { y := 10 } // } diff --git a/test/libyul/yulOptimizerTests/deadCodeEliminator/no_removal.yul b/test/libyul/yulOptimizerTests/deadCodeEliminator/no_removal.yul index f647be25e..c1003538d 100644 --- a/test/libyul/yulOptimizerTests/deadCodeEliminator/no_removal.yul +++ b/test/libyul/yulOptimizerTests/deadCodeEliminator/no_removal.yul @@ -8,8 +8,6 @@ // step: deadCodeEliminator // ---- // { -// { -// revert(0, 0) -// } +// { revert(0, 0) } // mstore(0, 0) // } diff --git a/test/libyul/yulOptimizerTests/deadCodeEliminator/normal_break.yul b/test/libyul/yulOptimizerTests/deadCodeEliminator/normal_break.yul index fadf98981..77e4303b6 100644 --- a/test/libyul/yulOptimizerTests/deadCodeEliminator/normal_break.yul +++ b/test/libyul/yulOptimizerTests/deadCodeEliminator/normal_break.yul @@ -17,12 +17,7 @@ // ---- // { // let a := 20 -// for { -// } -// lt(a, 40) -// { -// a := add(a, 2) -// } +// for { } lt(a, 40) { a := add(a, 2) } // { // a := a // break diff --git a/test/libyul/yulOptimizerTests/deadCodeEliminator/normal_continue.yul b/test/libyul/yulOptimizerTests/deadCodeEliminator/normal_continue.yul index cc4770dc5..e3a0b7a2f 100644 --- a/test/libyul/yulOptimizerTests/deadCodeEliminator/normal_continue.yul +++ b/test/libyul/yulOptimizerTests/deadCodeEliminator/normal_continue.yul @@ -17,12 +17,7 @@ // ---- // { // let a := 20 -// for { -// } -// lt(a, 40) -// { -// a := add(a, 2) -// } +// for { } lt(a, 40) { a := add(a, 2) } // { // a := a // continue diff --git a/test/libyul/yulOptimizerTests/deadCodeEliminator/normal_stop.yul b/test/libyul/yulOptimizerTests/deadCodeEliminator/normal_stop.yul index fa02b2c88..561ac2066 100644 --- a/test/libyul/yulOptimizerTests/deadCodeEliminator/normal_stop.yul +++ b/test/libyul/yulOptimizerTests/deadCodeEliminator/normal_stop.yul @@ -21,12 +21,7 @@ // { // let b := 20 // let a := 20 -// for { -// } -// lt(a, 40) -// { -// a := add(a, 2) -// } +// for { } lt(a, 40) { a := add(a, 2) } // { // a := a // mstore(0, a) diff --git a/test/libyul/yulOptimizerTests/disambiguator/for_statement.yul b/test/libyul/yulOptimizerTests/disambiguator/for_statement.yul index 5158d0f2b..ae7c0e114 100644 --- a/test/libyul/yulOptimizerTests/disambiguator/for_statement.yul +++ b/test/libyul/yulOptimizerTests/disambiguator/for_statement.yul @@ -11,19 +11,9 @@ // yul: true // ---- // { +// { let a:u256, b:u256 } // { -// let a:u256, b:u256 -// } -// { -// for { -// let a_1:u256 -// } -// a_1 -// { -// a_1 := a_1 -// } -// { -// let b_2:u256 := a_1 -// } +// for { let a_1:u256 } a_1 { a_1 := a_1 } +// { let b_2:u256 := a_1 } // } // } diff --git a/test/libyul/yulOptimizerTests/disambiguator/if_statement.yul b/test/libyul/yulOptimizerTests/disambiguator/if_statement.yul index 375030564..5dd6ac3bf 100644 --- a/test/libyul/yulOptimizerTests/disambiguator/if_statement.yul +++ b/test/libyul/yulOptimizerTests/disambiguator/if_statement.yul @@ -10,14 +10,9 @@ // yul: true // ---- // { -// { -// let a:u256, b:u256, c:u256 -// } +// { let a:u256, b:u256, c:u256 } // { // let a_1:bool -// if a_1 -// { -// let b_2:bool := a_1 -// } +// if a_1 { let b_2:bool := a_1 } // } // } diff --git a/test/libyul/yulOptimizerTests/disambiguator/smoke.yul b/test/libyul/yulOptimizerTests/disambiguator/smoke.yul index c753de829..bfe22582a 100644 --- a/test/libyul/yulOptimizerTests/disambiguator/smoke.yul +++ b/test/libyul/yulOptimizerTests/disambiguator/smoke.yul @@ -2,5 +2,4 @@ // ==== // step: disambiguator // ---- -// { -// } +// { } diff --git a/test/libyul/yulOptimizerTests/disambiguator/smoke_yul.yul b/test/libyul/yulOptimizerTests/disambiguator/smoke_yul.yul index 18e47d0bc..d0702de6f 100644 --- a/test/libyul/yulOptimizerTests/disambiguator/smoke_yul.yul +++ b/test/libyul/yulOptimizerTests/disambiguator/smoke_yul.yul @@ -3,5 +3,4 @@ // step: disambiguator // yul: true // ---- -// { -// } +// { } diff --git a/test/libyul/yulOptimizerTests/disambiguator/switch_statement.yul b/test/libyul/yulOptimizerTests/disambiguator/switch_statement.yul index d17afaf63..497f4985c 100644 --- a/test/libyul/yulOptimizerTests/disambiguator/switch_statement.yul +++ b/test/libyul/yulOptimizerTests/disambiguator/switch_statement.yul @@ -12,17 +12,11 @@ // yul: true // ---- // { -// { -// let a:u256, b:u256, c:u256 -// } +// { let a:u256, b:u256, c:u256 } // { // let a_1:u256 // switch a_1 -// case 0:u256 { -// let b_2:u256 := a_1 -// } -// default { -// let c_3:u256 := a_1 -// } +// case 0:u256 { let b_2:u256 := a_1 } +// default { let c_3:u256 := a_1 } // } // } diff --git a/test/libyul/yulOptimizerTests/disambiguator/variables.yul b/test/libyul/yulOptimizerTests/disambiguator/variables.yul index 7ae1a11b7..2d3318702 100644 --- a/test/libyul/yulOptimizerTests/disambiguator/variables.yul +++ b/test/libyul/yulOptimizerTests/disambiguator/variables.yul @@ -4,10 +4,6 @@ // yul: true // ---- // { -// { -// let a:u256 -// } -// { -// let a_1:u256 -// } +// { let a:u256 } +// { let a_1:u256 } // } diff --git a/test/libyul/yulOptimizerTests/disambiguator/variables_clash.yul b/test/libyul/yulOptimizerTests/disambiguator/variables_clash.yul index 46d0ac897..9501b8a1c 100644 --- a/test/libyul/yulOptimizerTests/disambiguator/variables_clash.yul +++ b/test/libyul/yulOptimizerTests/disambiguator/variables_clash.yul @@ -8,7 +8,5 @@ // let a:u256 // let a_1:u256 // } -// { -// let a_2:u256 -// } +// { let a_2:u256 } // } diff --git a/test/libyul/yulOptimizerTests/disambiguator/variables_inside_functions.yul b/test/libyul/yulOptimizerTests/disambiguator/variables_inside_functions.yul index c0d59f923..b160f032c 100644 --- a/test/libyul/yulOptimizerTests/disambiguator/variables_inside_functions.yul +++ b/test/libyul/yulOptimizerTests/disambiguator/variables_inside_functions.yul @@ -15,9 +15,7 @@ // let b:u256 // } // function f(a:u256, c_1:u256) -> b_2:u256 -// { -// let x:u256 -// } +// { let x:u256 } // { // let a_3:u256 // let x_4:u256 diff --git a/test/libyul/yulOptimizerTests/equivalentFunctionCombiner/multiple_complex.yul b/test/libyul/yulOptimizerTests/equivalentFunctionCombiner/multiple_complex.yul index 97f239ce8..e400e69ae 100644 --- a/test/libyul/yulOptimizerTests/equivalentFunctionCombiner/multiple_complex.yul +++ b/test/libyul/yulOptimizerTests/equivalentFunctionCombiner/multiple_complex.yul @@ -65,51 +65,27 @@ // { // switch f1 // case 0 { -// if f2 -// { -// rf := f3 -// } -// if not(f2) -// { -// rf := f1 -// } -// } -// default { -// rf := 3 +// if f2 { rf := f3 } +// if not(f2) { rf := f1 } // } +// default { rf := 3 } // } // function g(g1, g2, g3) -> rg // { // switch g1 // case 0 { -// if g2 -// { -// rg := g3 -// } -// if not(g2) -// { -// rg := g1 -// } -// } -// default { -// rg := 3 +// if g2 { rg := g3 } +// if not(g2) { rg := g1 } // } +// default { rg := 3 } // } // function h(h1, h2, h3) -> rh // { // switch h1 // case 1 { -// if h2 -// { -// rh := h3 -// } -// if not(h2) -// { -// rh := h1 -// } -// } -// default { -// rh := 3 +// if h2 { rh := h3 } +// if not(h2) { rh := h1 } // } +// default { rh := 3 } // } // } diff --git a/test/libyul/yulOptimizerTests/equivalentFunctionCombiner/simple.yul b/test/libyul/yulOptimizerTests/equivalentFunctionCombiner/simple.yul index aa53c5797..43629175b 100644 --- a/test/libyul/yulOptimizerTests/equivalentFunctionCombiner/simple.yul +++ b/test/libyul/yulOptimizerTests/equivalentFunctionCombiner/simple.yul @@ -11,11 +11,7 @@ // f() // f() // function f() -// { -// mstore(1, mload(0)) -// } +// { mstore(1, mload(0)) } // function g() -// { -// mstore(1, mload(0)) -// } +// { mstore(1, mload(0)) } // } diff --git a/test/libyul/yulOptimizerTests/equivalentFunctionCombiner/switch_case_order.yul b/test/libyul/yulOptimizerTests/equivalentFunctionCombiner/switch_case_order.yul index 9f3ccc6ec..9de10889b 100644 --- a/test/libyul/yulOptimizerTests/equivalentFunctionCombiner/switch_case_order.yul +++ b/test/libyul/yulOptimizerTests/equivalentFunctionCombiner/switch_case_order.yul @@ -13,21 +13,13 @@ // function f(x) // { // switch x -// case 0 { -// mstore(0, 42) -// } -// case 1 { -// mstore(1, 42) -// } +// case 0 { mstore(0, 42) } +// case 1 { mstore(1, 42) } // } // function g(x_1) // { // switch x_1 -// case 1 { -// mstore(1, 42) -// } -// case 0 { -// mstore(0, 42) -// } +// case 1 { mstore(1, 42) } +// case 0 { mstore(0, 42) } // } // } diff --git a/test/libyul/yulOptimizerTests/expressionInliner/complex_with_evm.yul b/test/libyul/yulOptimizerTests/expressionInliner/complex_with_evm.yul index 34d4eb986..e95c4144c 100644 --- a/test/libyul/yulOptimizerTests/expressionInliner/complex_with_evm.yul +++ b/test/libyul/yulOptimizerTests/expressionInliner/complex_with_evm.yul @@ -7,8 +7,6 @@ // ---- // { // function f(a) -> x -// { -// x := add(a, a) -// } +// { x := add(a, a) } // let y := add(calldatasize(), calldatasize()) // } diff --git a/test/libyul/yulOptimizerTests/expressionInliner/double_calls.yul b/test/libyul/yulOptimizerTests/expressionInliner/double_calls.yul index deae8482b..d19082f2e 100644 --- a/test/libyul/yulOptimizerTests/expressionInliner/double_calls.yul +++ b/test/libyul/yulOptimizerTests/expressionInliner/double_calls.yul @@ -8,12 +8,8 @@ // ---- // { // function f(a) -> x -// { -// x := add(a, a) -// } +// { x := add(a, a) } // function g(b, c) -> y -// { -// y := mul(mload(c), add(b, b)) -// } +// { y := mul(mload(c), add(b, b)) } // let y_1 := mul(mload(7), add(calldatasize(), calldatasize())) // } diff --git a/test/libyul/yulOptimizerTests/expressionInliner/double_recursive_calls.yul b/test/libyul/yulOptimizerTests/expressionInliner/double_recursive_calls.yul index 80843eca7..923032af0 100644 --- a/test/libyul/yulOptimizerTests/expressionInliner/double_recursive_calls.yul +++ b/test/libyul/yulOptimizerTests/expressionInliner/double_recursive_calls.yul @@ -8,9 +8,7 @@ // ---- // { // function f(a, r) -> x -// { -// x := g(a, f(r, f(r, r))) -// } +// { x := g(a, f(r, f(r, r))) } // function g(b, s) -> y // { // y := f(b, g(s, f(s, f(s, s)))) diff --git a/test/libyul/yulOptimizerTests/expressionInliner/no_inline_mload.yul b/test/libyul/yulOptimizerTests/expressionInliner/no_inline_mload.yul index fc4ec9720..1b2b702fe 100644 --- a/test/libyul/yulOptimizerTests/expressionInliner/no_inline_mload.yul +++ b/test/libyul/yulOptimizerTests/expressionInliner/no_inline_mload.yul @@ -8,8 +8,6 @@ // ---- // { // function f(a) -> x -// { -// x := a -// } +// { x := a } // let y := f(mload(2)) // } diff --git a/test/libyul/yulOptimizerTests/expressionInliner/no_move_with_sideeffects.yul b/test/libyul/yulOptimizerTests/expressionInliner/no_move_with_sideeffects.yul index eaaa863b1..5a116bcc3 100644 --- a/test/libyul/yulOptimizerTests/expressionInliner/no_move_with_sideeffects.yul +++ b/test/libyul/yulOptimizerTests/expressionInliner/no_move_with_sideeffects.yul @@ -11,9 +11,7 @@ // ---- // { // function f(a, b) -> x -// { -// x := add(b, a) -// } +// { x := add(b, a) } // function g() -> y // { // y := mload(0) diff --git a/test/libyul/yulOptimizerTests/expressionInliner/simple.yul b/test/libyul/yulOptimizerTests/expressionInliner/simple.yul index c1e9c1206..4302da79f 100644 --- a/test/libyul/yulOptimizerTests/expressionInliner/simple.yul +++ b/test/libyul/yulOptimizerTests/expressionInliner/simple.yul @@ -8,8 +8,6 @@ // ---- // { // function f() -> x:u256 -// { -// x := 2:u256 -// } +// { x := 2:u256 } // let y:u256 := 2:u256 // } diff --git a/test/libyul/yulOptimizerTests/expressionInliner/with_args.yul b/test/libyul/yulOptimizerTests/expressionInliner/with_args.yul index 1d049cdfe..2bdd8ffd8 100644 --- a/test/libyul/yulOptimizerTests/expressionInliner/with_args.yul +++ b/test/libyul/yulOptimizerTests/expressionInliner/with_args.yul @@ -8,8 +8,6 @@ // ---- // { // function f(a:u256) -> x:u256 -// { -// x := a -// } +// { x := a } // let y:u256 := 7:u256 // } diff --git a/test/libyul/yulOptimizerTests/expressionJoiner/if_condition.yul b/test/libyul/yulOptimizerTests/expressionJoiner/if_condition.yul index 78ecfc88c..b2a204482 100644 --- a/test/libyul/yulOptimizerTests/expressionJoiner/if_condition.yul +++ b/test/libyul/yulOptimizerTests/expressionJoiner/if_condition.yul @@ -14,9 +14,6 @@ // step: expressionJoiner // ---- // { -// if add(mload(7), sload(mload(3))) -// { -// let y := add(mload(3), 3) -// } +// if add(mload(7), sload(mload(3))) { let y := add(mload(3), 3) } // let t := add(3, 9) // } diff --git a/test/libyul/yulOptimizerTests/expressionJoiner/no_replacement_in_loop_condition1.yul b/test/libyul/yulOptimizerTests/expressionJoiner/no_replacement_in_loop_condition1.yul index 091a12566..0cc4e8f6d 100644 --- a/test/libyul/yulOptimizerTests/expressionJoiner/no_replacement_in_loop_condition1.yul +++ b/test/libyul/yulOptimizerTests/expressionJoiner/no_replacement_in_loop_condition1.yul @@ -5,12 +5,6 @@ // step: expressionJoiner // ---- // { -// for { -// let b := mload(1) -// } -// b -// { -// } -// { -// } +// for { let b := mload(1) } b { } +// { } // } diff --git a/test/libyul/yulOptimizerTests/expressionJoiner/no_replacement_in_loop_condition2.yul b/test/libyul/yulOptimizerTests/expressionJoiner/no_replacement_in_loop_condition2.yul index 3e86d6078..144476904 100644 --- a/test/libyul/yulOptimizerTests/expressionJoiner/no_replacement_in_loop_condition2.yul +++ b/test/libyul/yulOptimizerTests/expressionJoiner/no_replacement_in_loop_condition2.yul @@ -7,11 +7,6 @@ // ---- // { // let a := mload(0) -// for { -// } -// a -// { -// } -// { -// } +// for { } a { } +// { } // } diff --git a/test/libyul/yulOptimizerTests/expressionJoiner/smoke.yul b/test/libyul/yulOptimizerTests/expressionJoiner/smoke.yul index 1161c2092..7eb5f5285 100644 --- a/test/libyul/yulOptimizerTests/expressionJoiner/smoke.yul +++ b/test/libyul/yulOptimizerTests/expressionJoiner/smoke.yul @@ -2,5 +2,4 @@ // ==== // step: expressionJoiner // ---- -// { -// } +// { } diff --git a/test/libyul/yulOptimizerTests/expressionJoiner/switch_expression.yul b/test/libyul/yulOptimizerTests/expressionJoiner/switch_expression.yul index 9ab421533..e8e787762 100644 --- a/test/libyul/yulOptimizerTests/expressionJoiner/switch_expression.yul +++ b/test/libyul/yulOptimizerTests/expressionJoiner/switch_expression.yul @@ -19,11 +19,7 @@ // ---- // { // switch add(mload(7), sload(mload(3))) -// case 3 { -// let y := add(mload(3), 3) -// } -// default { -// sstore(1, 0) -// } +// case 3 { let y := add(mload(3), 3) } +// default { sstore(1, 0) } // let t := add(3, 9) // } diff --git a/test/libyul/yulOptimizerTests/expressionSimplifier/assigned_vars_multi.yul b/test/libyul/yulOptimizerTests/expressionSimplifier/assigned_vars_multi.yul index 74604e771..809f6ff23 100644 --- a/test/libyul/yulOptimizerTests/expressionSimplifier/assigned_vars_multi.yul +++ b/test/libyul/yulOptimizerTests/expressionSimplifier/assigned_vars_multi.yul @@ -8,8 +8,7 @@ // ---- // { // function f() -> x, z -// { -// } +// { } // let c, d := f() // let y := add(add(d, c), 7) // } diff --git a/test/libyul/yulOptimizerTests/expressionSimplifier/constant_propagation.yul b/test/libyul/yulOptimizerTests/expressionSimplifier/constant_propagation.yul index b0f675ac8..983a3b251 100644 --- a/test/libyul/yulOptimizerTests/expressionSimplifier/constant_propagation.yul +++ b/test/libyul/yulOptimizerTests/expressionSimplifier/constant_propagation.yul @@ -2,6 +2,4 @@ // ==== // step: expressionSimplifier // ---- -// { -// let a := mload(0) -// } +// { let a := mload(0) } diff --git a/test/libyul/yulOptimizerTests/expressionSimplifier/constants.yul b/test/libyul/yulOptimizerTests/expressionSimplifier/constants.yul index daebf97f7..efbcf8712 100644 --- a/test/libyul/yulOptimizerTests/expressionSimplifier/constants.yul +++ b/test/libyul/yulOptimizerTests/expressionSimplifier/constants.yul @@ -2,6 +2,4 @@ // ==== // step: expressionSimplifier // ---- -// { -// let a := 13 -// } +// { let a := 13 } diff --git a/test/libyul/yulOptimizerTests/expressionSimplifier/identity_rules_complex.yul b/test/libyul/yulOptimizerTests/expressionSimplifier/identity_rules_complex.yul index f3298e510..e7b60d2df 100644 --- a/test/libyul/yulOptimizerTests/expressionSimplifier/identity_rules_complex.yul +++ b/test/libyul/yulOptimizerTests/expressionSimplifier/identity_rules_complex.yul @@ -2,6 +2,4 @@ // ==== // step: expressionSimplifier // ---- -// { -// let a := 0 -// } +// { let a := 0 } diff --git a/test/libyul/yulOptimizerTests/expressionSimplifier/including_function_calls.yul b/test/libyul/yulOptimizerTests/expressionSimplifier/including_function_calls.yul index ad8f3c33a..0c92afe38 100644 --- a/test/libyul/yulOptimizerTests/expressionSimplifier/including_function_calls.yul +++ b/test/libyul/yulOptimizerTests/expressionSimplifier/including_function_calls.yul @@ -7,7 +7,6 @@ // ---- // { // function f() -> a -// { -// } +// { } // let b := f() // } diff --git a/test/libyul/yulOptimizerTests/expressionSimplifier/inside_for.yul b/test/libyul/yulOptimizerTests/expressionSimplifier/inside_for.yul index 336778599..83906d675 100644 --- a/test/libyul/yulOptimizerTests/expressionSimplifier/inside_for.yul +++ b/test/libyul/yulOptimizerTests/expressionSimplifier/inside_for.yul @@ -7,12 +7,6 @@ // ---- // { // let a := 10 -// for { -// } -// iszero(iszero(a)) -// { -// a := add(a, 1) -// } -// { -// } +// for { } iszero(iszero(a)) { a := add(a, 1) } +// { } // } diff --git a/test/libyul/yulOptimizerTests/expressionSimplifier/not_applied_function_call_different_arguments.yul b/test/libyul/yulOptimizerTests/expressionSimplifier/not_applied_function_call_different_arguments.yul index d769143da..1430fd718 100644 --- a/test/libyul/yulOptimizerTests/expressionSimplifier/not_applied_function_call_different_arguments.yul +++ b/test/libyul/yulOptimizerTests/expressionSimplifier/not_applied_function_call_different_arguments.yul @@ -7,7 +7,6 @@ // ---- // { // function f(a) -> b -// { -// } +// { } // let c := sub(f(0), f(1)) // } diff --git a/test/libyul/yulOptimizerTests/expressionSimplifier/not_applied_function_call_different_names.yul b/test/libyul/yulOptimizerTests/expressionSimplifier/not_applied_function_call_different_names.yul index be80fee19..cc819fff8 100644 --- a/test/libyul/yulOptimizerTests/expressionSimplifier/not_applied_function_call_different_names.yul +++ b/test/libyul/yulOptimizerTests/expressionSimplifier/not_applied_function_call_different_names.yul @@ -8,10 +8,8 @@ // ---- // { // function f1() -> a -// { -// } +// { } // function f2() -> b -// { -// } +// { } // let c := sub(f1(), f2()) // } diff --git a/test/libyul/yulOptimizerTests/expressionSimplifier/not_applied_function_call_equality_not_movable.yul b/test/libyul/yulOptimizerTests/expressionSimplifier/not_applied_function_call_equality_not_movable.yul index bc0664939..fc43fa788 100644 --- a/test/libyul/yulOptimizerTests/expressionSimplifier/not_applied_function_call_equality_not_movable.yul +++ b/test/libyul/yulOptimizerTests/expressionSimplifier/not_applied_function_call_equality_not_movable.yul @@ -8,7 +8,6 @@ // ---- // { // function f() -> a -// { -// } +// { } // let b := sub(f(), f()) // } diff --git a/test/libyul/yulOptimizerTests/expressionSimplifier/return_vars_zero.yul b/test/libyul/yulOptimizerTests/expressionSimplifier/return_vars_zero.yul index 250f5f6fb..8586396c4 100644 --- a/test/libyul/yulOptimizerTests/expressionSimplifier/return_vars_zero.yul +++ b/test/libyul/yulOptimizerTests/expressionSimplifier/return_vars_zero.yul @@ -9,7 +9,5 @@ // ---- // { // function f() -> c, d -// { -// let y := 7 -// } +// { let y := 7 } // } diff --git a/test/libyul/yulOptimizerTests/expressionSimplifier/reversed.yul b/test/libyul/yulOptimizerTests/expressionSimplifier/reversed.yul index e993763a7..1d398f833 100644 --- a/test/libyul/yulOptimizerTests/expressionSimplifier/reversed.yul +++ b/test/libyul/yulOptimizerTests/expressionSimplifier/reversed.yul @@ -4,6 +4,4 @@ // ==== // step: expressionSimplifier // ---- -// { -// let a := mload(0) -// } +// { let a := mload(0) } diff --git a/test/libyul/yulOptimizerTests/expressionSimplifier/smoke.yul b/test/libyul/yulOptimizerTests/expressionSimplifier/smoke.yul index 7503f997d..7562dfb47 100644 --- a/test/libyul/yulOptimizerTests/expressionSimplifier/smoke.yul +++ b/test/libyul/yulOptimizerTests/expressionSimplifier/smoke.yul @@ -2,5 +2,4 @@ // ==== // step: expressionSimplifier // ---- -// { -// } +// { } diff --git a/test/libyul/yulOptimizerTests/expressionSplitter/control_flow.yul b/test/libyul/yulOptimizerTests/expressionSplitter/control_flow.yul index d7a21da12..2eb72c112 100644 --- a/test/libyul/yulOptimizerTests/expressionSplitter/control_flow.yul +++ b/test/libyul/yulOptimizerTests/expressionSplitter/control_flow.yul @@ -19,9 +19,7 @@ // let _5 := mul(_4, _2) // if _5 // { -// for { -// let a := 2 -// } +// for { let a := 2 } // lt(a, mload(a)) // { // let _6 := 2 @@ -38,4 +36,4 @@ // sstore(b, _12) // } // } -// } \ No newline at end of file +// } diff --git a/test/libyul/yulOptimizerTests/expressionSplitter/smoke.yul b/test/libyul/yulOptimizerTests/expressionSplitter/smoke.yul index bcbc1a658..c47eebe7b 100644 --- a/test/libyul/yulOptimizerTests/expressionSplitter/smoke.yul +++ b/test/libyul/yulOptimizerTests/expressionSplitter/smoke.yul @@ -2,5 +2,4 @@ // ==== // step: expressionSplitter // ---- -// { -// } +// { } diff --git a/test/libyul/yulOptimizerTests/forLoopInitRewriter/complex_pre.yul b/test/libyul/yulOptimizerTests/forLoopInitRewriter/complex_pre.yul index 6dc96a37e..951a5fbe6 100644 --- a/test/libyul/yulOptimizerTests/forLoopInitRewriter/complex_pre.yul +++ b/test/libyul/yulOptimizerTests/forLoopInitRewriter/complex_pre.yul @@ -12,13 +12,6 @@ // let random := 42 // let a := 1 // let b := 1 -// for { -// } -// iszero(eq(a, 10)) -// { -// a := add(a, b) -// } -// { -// a := add(a, 1) -// } +// for { } iszero(eq(a, 10)) { a := add(a, b) } +// { a := add(a, 1) } // } diff --git a/test/libyul/yulOptimizerTests/forLoopInitRewriter/empty_pre.yul b/test/libyul/yulOptimizerTests/forLoopInitRewriter/empty_pre.yul index 45df8479c..9fa5fd37e 100644 --- a/test/libyul/yulOptimizerTests/forLoopInitRewriter/empty_pre.yul +++ b/test/libyul/yulOptimizerTests/forLoopInitRewriter/empty_pre.yul @@ -9,13 +9,6 @@ // ---- // { // let a := 1 -// for { -// } -// iszero(eq(a, 10)) -// { -// a := add(a, 1) -// } -// { -// a := add(a, 1) -// } +// for { } iszero(eq(a, 10)) { a := add(a, 1) } +// { a := add(a, 1) } // } diff --git a/test/libyul/yulOptimizerTests/forLoopInitRewriter/nested.yul b/test/libyul/yulOptimizerTests/forLoopInitRewriter/nested.yul index afeed5dc5..c751f4483 100644 --- a/test/libyul/yulOptimizerTests/forLoopInitRewriter/nested.yul +++ b/test/libyul/yulOptimizerTests/forLoopInitRewriter/nested.yul @@ -19,31 +19,15 @@ // { // let random := 42 // let a := 1 -// for { -// } -// iszero(eq(a, 10)) -// { -// } -// { -// a := add(a, 1) -// } +// for { } iszero(eq(a, 10)) { } +// { a := add(a, 1) } // let b := 1 -// for { -// } +// for { } // iszero(eq(b, 10)) // { // let c := 1 -// for { -// } -// iszero(eq(c, 2)) -// { -// c := add(c, 1) -// } -// { -// b := add(b, 1) -// } -// } -// { -// mstore(b, b) +// for { } iszero(eq(c, 2)) { c := add(c, 1) } +// { b := add(b, 1) } // } +// { mstore(b, b) } // } diff --git a/test/libyul/yulOptimizerTests/forLoopInitRewriter/simple.yul b/test/libyul/yulOptimizerTests/forLoopInitRewriter/simple.yul index 91078561c..c8db1e5aa 100644 --- a/test/libyul/yulOptimizerTests/forLoopInitRewriter/simple.yul +++ b/test/libyul/yulOptimizerTests/forLoopInitRewriter/simple.yul @@ -10,13 +10,6 @@ // { // let random := 42 // let a := 1 -// for { -// } -// iszero(eq(a, 10)) -// { -// a := add(a, 1) -// } -// { -// a := add(a, 1) -// } +// for { } iszero(eq(a, 10)) { a := add(a, 1) } +// { a := add(a, 1) } // } diff --git a/test/libyul/yulOptimizerTests/fullInliner/inside_condition.yul b/test/libyul/yulOptimizerTests/fullInliner/inside_condition.yul index a81d34ef3..fd9d893ae 100644 --- a/test/libyul/yulOptimizerTests/fullInliner/inside_condition.yul +++ b/test/libyul/yulOptimizerTests/fullInliner/inside_condition.yul @@ -18,10 +18,7 @@ // let r_11 := 0 // a_10 := mload(a_10) // r_11 := add(a_10, calldatasize()) -// if gt(r_11, _2) -// { -// sstore(0, 2) -// } +// if gt(r_11, _2) { sstore(0, 2) } // } // function f(a) -> r // { diff --git a/test/libyul/yulOptimizerTests/fullInliner/multi_fun.yul b/test/libyul/yulOptimizerTests/fullInliner/multi_fun.yul index b372da9ae..2f8a85842 100644 --- a/test/libyul/yulOptimizerTests/fullInliner/multi_fun.yul +++ b/test/libyul/yulOptimizerTests/fullInliner/multi_fun.yul @@ -19,9 +19,7 @@ // let y_1 := y_10 // } // function f(a) -> x -// { -// x := add(a, a) -// } +// { x := add(a, a) } // function g(b, c) -> y // { // let a_13 := b diff --git a/test/libyul/yulOptimizerTests/fullInliner/multi_fun_callback.yul b/test/libyul/yulOptimizerTests/fullInliner/multi_fun_callback.yul index aa4b7cb86..e5cf71caa 100644 --- a/test/libyul/yulOptimizerTests/fullInliner/multi_fun_callback.yul +++ b/test/libyul/yulOptimizerTests/fullInliner/multi_fun_callback.yul @@ -56,7 +56,5 @@ // mstore(1, x_14) // } // function h() -> t -// { -// t := 2 -// } +// { t := 2 } // } diff --git a/test/libyul/yulOptimizerTests/fullInliner/no_inline_into_big_function.yul b/test/libyul/yulOptimizerTests/fullInliner/no_inline_into_big_function.yul index cbbe57d29..4a7837ca2 100644 --- a/test/libyul/yulOptimizerTests/fullInliner/no_inline_into_big_function.yul +++ b/test/libyul/yulOptimizerTests/fullInliner/no_inline_into_big_function.yul @@ -14,9 +14,7 @@ // ---- // { // function f(a) -> b -// { -// b := sload(mload(a)) -// } +// { b := sload(mload(a)) } // function g() -> x_1 // { // let a_20 := 2 diff --git a/test/libyul/yulOptimizerTests/fullInliner/no_inline_into_big_global_context.yul b/test/libyul/yulOptimizerTests/fullInliner/no_inline_into_big_global_context.yul index 354a6eff4..337612d37 100644 --- a/test/libyul/yulOptimizerTests/fullInliner/no_inline_into_big_global_context.yul +++ b/test/libyul/yulOptimizerTests/fullInliner/no_inline_into_big_global_context.yul @@ -54,7 +54,5 @@ // let x_1 := f(f(f(f(f(f(b_57)))))) // } // function f(a) -> b -// { -// b := sload(mload(a)) -// } +// { b := sload(mload(a)) } // } diff --git a/test/libyul/yulOptimizerTests/fullInliner/no_return.yul b/test/libyul/yulOptimizerTests/fullInliner/no_return.yul index 258c07a61..c45e7a3c7 100644 --- a/test/libyul/yulOptimizerTests/fullInliner/no_return.yul +++ b/test/libyul/yulOptimizerTests/fullInliner/no_return.yul @@ -13,7 +13,5 @@ // sstore(a_3, a_3) // } // function f(a) -// { -// sstore(a, a) -// } +// { sstore(a, a) } // } diff --git a/test/libyul/yulOptimizerTests/fullInliner/not_inside_for.yul b/test/libyul/yulOptimizerTests/fullInliner/not_inside_for.yul index 7f146f5e5..94282bf5c 100644 --- a/test/libyul/yulOptimizerTests/fullInliner/not_inside_for.yul +++ b/test/libyul/yulOptimizerTests/fullInliner/not_inside_for.yul @@ -19,8 +19,7 @@ // sstore(a_3, 0) // r_4 := a_3 // let x := r_4 -// for { -// } +// for { } // f(x) // { // let a_6 := x diff --git a/test/libyul/yulOptimizerTests/fullInliner/recursion.yul b/test/libyul/yulOptimizerTests/fullInliner/recursion.yul index 175d44fd2..6f7feb77f 100644 --- a/test/libyul/yulOptimizerTests/fullInliner/recursion.yul +++ b/test/libyul/yulOptimizerTests/fullInliner/recursion.yul @@ -13,7 +13,5 @@ // f(1) // } // function f(a) -// { -// f(1) -// } +// { f(1) } // } diff --git a/test/libyul/yulOptimizerTests/fullSimplify/constants.yul b/test/libyul/yulOptimizerTests/fullSimplify/constants.yul index 814562fad..2ea5ea442 100644 --- a/test/libyul/yulOptimizerTests/fullSimplify/constants.yul +++ b/test/libyul/yulOptimizerTests/fullSimplify/constants.yul @@ -5,6 +5,4 @@ // ==== // step: fullSimplify // ---- -// { -// mstore(0, 13) -// } +// { mstore(0, 13) } diff --git a/test/libyul/yulOptimizerTests/fullSimplify/identity_rules_complex.yul b/test/libyul/yulOptimizerTests/fullSimplify/identity_rules_complex.yul index eaa0845da..df7712b7a 100644 --- a/test/libyul/yulOptimizerTests/fullSimplify/identity_rules_complex.yul +++ b/test/libyul/yulOptimizerTests/fullSimplify/identity_rules_complex.yul @@ -5,6 +5,4 @@ // ==== // step: fullSimplify // ---- -// { -// mstore(0, 0) -// } +// { mstore(0, 0) } diff --git a/test/libyul/yulOptimizerTests/fullSimplify/including_function_calls.yul b/test/libyul/yulOptimizerTests/fullSimplify/including_function_calls.yul index 469607d68..d75e681a4 100644 --- a/test/libyul/yulOptimizerTests/fullSimplify/including_function_calls.yul +++ b/test/libyul/yulOptimizerTests/fullSimplify/including_function_calls.yul @@ -8,7 +8,6 @@ // ---- // { // function f() -> a -// { -// } +// { } // mstore(f(), 0) // } diff --git a/test/libyul/yulOptimizerTests/fullSimplify/inside_for.yul b/test/libyul/yulOptimizerTests/fullSimplify/inside_for.yul index 972c9f267..339e744d7 100644 --- a/test/libyul/yulOptimizerTests/fullSimplify/inside_for.yul +++ b/test/libyul/yulOptimizerTests/fullSimplify/inside_for.yul @@ -8,12 +8,6 @@ // ---- // { // let a := 10 -// for { -// } -// iszero(iszero(a)) -// { -// a := add(a, 1) -// } -// { -// } +// for { } iszero(iszero(a)) { a := add(a, 1) } +// { } // } diff --git a/test/libyul/yulOptimizerTests/fullSimplify/not_applied_function_call_different_arguments.yul b/test/libyul/yulOptimizerTests/fullSimplify/not_applied_function_call_different_arguments.yul index f6d7912fd..5038a6fa9 100644 --- a/test/libyul/yulOptimizerTests/fullSimplify/not_applied_function_call_different_arguments.yul +++ b/test/libyul/yulOptimizerTests/fullSimplify/not_applied_function_call_different_arguments.yul @@ -7,8 +7,7 @@ // ---- // { // function f(a) -> b -// { -// } +// { } // let _2 := f(1) // let _3 := 0 // mstore(_3, sub(f(_3), _2)) diff --git a/test/libyul/yulOptimizerTests/fullSimplify/not_applied_function_call_different_names.yul b/test/libyul/yulOptimizerTests/fullSimplify/not_applied_function_call_different_names.yul index 655ad00ca..72ebadd20 100644 --- a/test/libyul/yulOptimizerTests/fullSimplify/not_applied_function_call_different_names.yul +++ b/test/libyul/yulOptimizerTests/fullSimplify/not_applied_function_call_different_names.yul @@ -9,10 +9,8 @@ // ---- // { // function f1() -> a -// { -// } +// { } // function f2() -> b -// { -// } +// { } // mstore(0, sub(f1(), f2())) // } diff --git a/test/libyul/yulOptimizerTests/fullSimplify/not_applied_function_call_equality_not_movable.yul b/test/libyul/yulOptimizerTests/fullSimplify/not_applied_function_call_equality_not_movable.yul index 00bba7a79..bb5b90b8b 100644 --- a/test/libyul/yulOptimizerTests/fullSimplify/not_applied_function_call_equality_not_movable.yul +++ b/test/libyul/yulOptimizerTests/fullSimplify/not_applied_function_call_equality_not_movable.yul @@ -9,7 +9,6 @@ // ---- // { // function f() -> a -// { -// } +// { } // mstore(0, sub(f(), f())) // } diff --git a/test/libyul/yulOptimizerTests/fullSimplify/smoke.yul b/test/libyul/yulOptimizerTests/fullSimplify/smoke.yul index de485f3d0..7ff4c60c3 100644 --- a/test/libyul/yulOptimizerTests/fullSimplify/smoke.yul +++ b/test/libyul/yulOptimizerTests/fullSimplify/smoke.yul @@ -2,5 +2,4 @@ // ==== // step: fullSimplify // ---- -// { -// } +// { } diff --git a/test/libyul/yulOptimizerTests/fullSuite/abi2.yul b/test/libyul/yulOptimizerTests/fullSuite/abi2.yul index 1983f2ebe..587d5c8c2 100644 --- a/test/libyul/yulOptimizerTests/fullSuite/abi2.yul +++ b/test/libyul/yulOptimizerTests/fullSuite/abi2.yul @@ -1076,10 +1076,7 @@ // { // let _1 := mload(1) // let _2 := mload(0) -// if slt(sub(_1, _2), 64) -// { -// revert(0, 0) -// } +// if slt(sub(_1, _2), 64) { revert(0, 0) } // sstore(0, and(calldataload(_2), 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF)) // let x0, x1, x2, x3, x4 := abi_decode_tuple_t_addresst_uint256t_bytes_calldata_ptrt_enum$_Operation_$1949(mload(7), mload(8)) // sstore(x1, x0) @@ -1089,39 +1086,21 @@ // } // function abi_decode_tuple_t_addresst_uint256t_bytes_calldata_ptrt_enum$_Operation_$1949(headStart, dataEnd) -> value0, value1, value2, value3, value4 // { -// if slt(sub(dataEnd, headStart), 128) -// { -// revert(value4, value4) -// } +// if slt(sub(dataEnd, headStart), 128) { revert(value4, value4) } // value0 := and(calldataload(headStart), 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF) // value1 := calldataload(add(headStart, 32)) // let offset := calldataload(add(headStart, 64)) // let _1 := 0xffffffffffffffff -// if gt(offset, _1) -// { -// revert(value4, value4) -// } +// if gt(offset, _1) { revert(value4, value4) } // let _2 := add(headStart, offset) -// if iszero(slt(add(_2, 0x1f), dataEnd)) -// { -// revert(value4, value4) -// } +// if iszero(slt(add(_2, 0x1f), dataEnd)) { revert(value4, value4) } // let length := calldataload(_2) -// if gt(length, _1) -// { -// revert(value4, value4) -// } -// if gt(add(add(_2, length), 32), dataEnd) -// { -// revert(value4, value4) -// } +// if gt(length, _1) { revert(value4, value4) } +// if gt(add(add(_2, length), 32), dataEnd) { revert(value4, value4) } // value2 := add(_2, 32) // value3 := length // let _3 := calldataload(add(headStart, 96)) -// if iszero(lt(_3, 3)) -// { -// revert(value4, value4) -// } +// if iszero(lt(_3, 3)) { revert(value4, value4) } // value4 := _3 // } // function abi_encode_tuple_t_bytes32_t_address_t_uint256_t_bytes32_t_enum$_Operation_$1949_t_uint256_t_uint256_t_uint256_t_address_t_address_t_uint256__to_t_bytes32_t_address_t_uint256_t_bytes32_t_uint8_t_uint256_t_uint256_t_uint256_t_address_t_address_t_uint256_(headStart, value10, value9, value8, value7, value6, value5, value4, value3, value2, value1, value0) -> tail @@ -1132,10 +1111,7 @@ // mstore(add(headStart, 32), and(value1, _1)) // mstore(add(headStart, 64), value2) // mstore(add(headStart, 96), value3) -// if iszero(lt(value4, 3)) -// { -// invalid() -// } +// if iszero(lt(value4, 3)) { invalid() } // mstore(add(headStart, 128), value4) // mstore(add(headStart, 160), value5) // mstore(add(headStart, 192), value6) diff --git a/test/libyul/yulOptimizerTests/fullSuite/abi_example1.yul b/test/libyul/yulOptimizerTests/fullSuite/abi_example1.yul index 312de61f0..945b90521 100644 --- a/test/libyul/yulOptimizerTests/fullSuite/abi_example1.yul +++ b/test/libyul/yulOptimizerTests/fullSuite/abi_example1.yul @@ -469,12 +469,7 @@ // pos := 64 // let srcPtr := add(_3, _1) // let i := _2 -// for { -// } -// lt(i, length) -// { -// i := add(i, 1) -// } +// for { } lt(i, length) { i := add(i, 1) } // { // abi_encode_t_array$_t_contract$_C_$55_$3_memory_to_t_array$_t_address_$3_memory_ptr(mload(srcPtr), pos) // srcPtr := add(srcPtr, _1) @@ -482,22 +477,13 @@ // } // let _4 := mload(64) // let _5 := mload(_1) -// if slt(sub(_4, _5), 128) -// { -// revert(_2, _2) -// } +// if slt(sub(_4, _5), 128) { revert(_2, _2) } // let offset := calldataload(add(_5, 64)) // let _6 := 0xffffffffffffffff -// if gt(offset, _6) -// { -// revert(_2, _2) -// } +// if gt(offset, _6) { revert(_2, _2) } // let value2 := abi_decode_t_array$_t_uint256_$dyn_memory_ptr(add(_5, offset), _4) // let offset_1 := calldataload(add(_5, 96)) -// if gt(offset_1, _6) -// { -// revert(_2, _2) -// } +// if gt(offset_1, _6) { revert(_2, _2) } // let value3 := abi_decode_t_array$_t_array$_t_uint256_$2_memory_$dyn_memory_ptr(add(_5, offset_1), _4) // sstore(calldataload(_5), calldataload(add(_5, _1))) // sstore(value2, value3) @@ -505,10 +491,7 @@ // } // function abi_decode_t_array$_t_array$_t_uint256_$2_memory_$dyn_memory_ptr(offset, end) -> array // { -// if iszero(slt(add(offset, 0x1f), end)) -// { -// revert(array, array) -// } +// if iszero(slt(add(offset, 0x1f), end)) { revert(array, array) } // let length := calldataload(offset) // array := allocateMemory(array_allocation_size_t_array$_t_address_$dyn_memory(length)) // let dst := array @@ -516,37 +499,18 @@ // let _1 := 0x20 // dst := add(array, _1) // let src := add(offset, _1) -// if gt(add(add(offset, mul(length, 0x40)), _1), end) -// { -// revert(0, 0) -// } +// if gt(add(add(offset, mul(length, 0x40)), _1), end) { revert(0, 0) } // let i := 0 -// for { -// } -// lt(i, length) +// for { } lt(i, length) { i := add(i, 1) } // { -// i := add(i, 1) -// } -// { -// if iszero(slt(add(src, 0x1f), end)) -// { -// revert(0, 0) -// } +// 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 // let src_1 := src // let _2 := add(src, 0x40) -// if gt(_2, end) -// { -// revert(0, 0) -// } +// if gt(_2, end) { revert(0, 0) } // let i_1 := 0 -// for { -// } -// lt(i_1, 0x2) -// { -// i_1 := add(i_1, 1) -// } +// for { } lt(i_1, 0x2) { i_1 := add(i_1, 1) } // { // mstore(dst_1, calldataload(src_1)) // dst_1 := add(dst_1, _1) @@ -559,10 +523,7 @@ // } // function abi_decode_t_array$_t_uint256_$dyn_memory_ptr(offset, end) -> array // { -// if iszero(slt(add(offset, 0x1f), end)) -// { -// revert(array, array) -// } +// if iszero(slt(add(offset, 0x1f), end)) { revert(array, array) } // let length := calldataload(offset) // array := allocateMemory(array_allocation_size_t_array$_t_address_$dyn_memory(length)) // let dst := array @@ -570,17 +531,9 @@ // let _1 := 0x20 // dst := add(array, _1) // let src := add(offset, _1) -// if gt(add(add(offset, mul(length, _1)), _1), end) -// { -// revert(0, 0) -// } +// if gt(add(add(offset, mul(length, _1)), _1), end) { revert(0, 0) } // let i := 0 -// for { -// } -// lt(i, length) -// { -// i := add(i, 1) -// } +// for { } lt(i, length) { i := add(i, 1) } // { // mstore(dst, calldataload(src)) // dst := add(dst, _1) @@ -591,12 +544,7 @@ // { // let srcPtr := value // let i := 0 -// for { -// } -// lt(i, 0x3) -// { -// i := add(i, 1) -// } +// for { } lt(i, 0x3) { i := add(i, 1) } // { // mstore(pos, and(mload(srcPtr), 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF)) // srcPtr := add(srcPtr, 0x20) @@ -607,26 +555,17 @@ // { // memPtr := mload(64) // let newFreePtr := add(memPtr, size) -// if or(gt(newFreePtr, 0xffffffffffffffff), lt(newFreePtr, memPtr)) -// { -// revert(0, 0) -// } +// if or(gt(newFreePtr, 0xffffffffffffffff), lt(newFreePtr, memPtr)) { revert(0, 0) } // mstore(64, newFreePtr) // } // function array_allocation_size_t_array$_t_address_$dyn_memory(length) -> size // { -// if gt(length, 0xffffffffffffffff) -// { -// revert(0, 0) -// } +// if gt(length, 0xffffffffffffffff) { revert(0, 0) } // 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(0, 0) } // size := mul(length, 0x20) // } // } diff --git a/test/libyul/yulOptimizerTests/fullSuite/aztec.yul b/test/libyul/yulOptimizerTests/fullSuite/aztec.yul index bfe9ea27d..5ad04f4c8 100644 --- a/test/libyul/yulOptimizerTests/fullSuite/aztec.yul +++ b/test/libyul/yulOptimizerTests/fullSuite/aztec.yul @@ -254,12 +254,7 @@ // let b := add(0x300, mul(n, 0x80)) // let i := 0 // let i_1 := i -// for { -// } -// lt(i, n) -// { -// i := add(i, 0x01) -// } +// for { } lt(i, n) { i := add(i, 0x01) } // { // let _1 := add(calldataload(0x04), mul(i, 0xc0)) // let noteIndex := add(_1, 0x24) @@ -270,14 +265,9 @@ // switch eq(_2, n) // case 1 { // k := kn -// if eq(m, n) -// { -// k := sub(gen_order, kn) -// } -// } -// case 0 { -// k := calldataload(noteIndex) +// if eq(m, n) { k := sub(gen_order, kn) } // } +// case 0 { k := calldataload(noteIndex) } // validateCommitment(noteIndex, k, a) // switch gt(_2, m) // case 1 { @@ -323,10 +313,7 @@ // } // b := add(b, _3) // } -// if lt(m, n) -// { -// validatePairing(0x64) -// } +// if lt(m, n) { validatePairing(0x64) } // if iszero(eq(mod(keccak256(0x2a0, add(b, 0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffd60)), gen_order), challenge)) // { // mstore(i_1, 404) @@ -388,12 +375,7 @@ // function hashCommitments(notes, n) // { // let i := 0 -// for { -// } -// lt(i, n) -// { -// i := add(i, 0x01) -// } +// for { } lt(i, n) { i := add(i, 0x01) } // { // calldatacopy(add(0x300, mul(i, 0x80)), add(add(notes, mul(i, 0xc0)), 0x60), 0x80) // } diff --git a/test/libyul/yulOptimizerTests/fullSuite/reuse_vars_bug_in_simplifier.yul b/test/libyul/yulOptimizerTests/fullSuite/reuse_vars_bug_in_simplifier.yul index ba797fa7b..bb350bf8f 100644 --- a/test/libyul/yulOptimizerTests/fullSuite/reuse_vars_bug_in_simplifier.yul +++ b/test/libyul/yulOptimizerTests/fullSuite/reuse_vars_bug_in_simplifier.yul @@ -12,8 +12,4 @@ // ==== // step: fullSuite // ---- -// { -// { -// mstore(1, 1) -// } -// } +// { { mstore(1, 1) } } diff --git a/test/libyul/yulOptimizerTests/fullSuite/ssaReverse.yul b/test/libyul/yulOptimizerTests/fullSuite/ssaReverse.yul index e9af2c227..25e279f67 100644 --- a/test/libyul/yulOptimizerTests/fullSuite/ssaReverse.yul +++ b/test/libyul/yulOptimizerTests/fullSuite/ssaReverse.yul @@ -47,19 +47,10 @@ // } // 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(0, 0) } // length := calldataload(offset) -// if gt(length, 0xffffffffffffffff) -// { -// revert(0, 0) -// } +// if gt(length, 0xffffffffffffffff) { revert(0, 0) } // arrayPos := add(offset, 0x20) -// if gt(add(add(offset, length), 0x20), end) -// { -// revert(0, 0) -// } +// if gt(add(add(offset, length), 0x20), end) { revert(0, 0) } // } // } diff --git a/test/libyul/yulOptimizerTests/fullSuite/switch_inline.yul b/test/libyul/yulOptimizerTests/fullSuite/switch_inline.yul index 9a463e320..2e878e437 100644 --- a/test/libyul/yulOptimizerTests/fullSuite/switch_inline.yul +++ b/test/libyul/yulOptimizerTests/fullSuite/switch_inline.yul @@ -9,8 +9,4 @@ // ==== // step: fullSuite // ---- -// { -// { -// mstore(9, 0) -// } -// } +// { { mstore(9, 0) } } diff --git a/test/libyul/yulOptimizerTests/fullSuite/switch_inline_match_default.yul b/test/libyul/yulOptimizerTests/fullSuite/switch_inline_match_default.yul index ad1d92c83..6710f1fee 100644 --- a/test/libyul/yulOptimizerTests/fullSuite/switch_inline_match_default.yul +++ b/test/libyul/yulOptimizerTests/fullSuite/switch_inline_match_default.yul @@ -10,8 +10,4 @@ // ==== // step: fullSuite // ---- -// { -// { -// mstore(10, 0) -// } -// } +// { { mstore(10, 0) } } diff --git a/test/libyul/yulOptimizerTests/functionGrouper/already_grouped.yul b/test/libyul/yulOptimizerTests/functionGrouper/already_grouped.yul index 98a8f2e39..95117c38e 100644 --- a/test/libyul/yulOptimizerTests/functionGrouper/already_grouped.yul +++ b/test/libyul/yulOptimizerTests/functionGrouper/already_grouped.yul @@ -8,11 +8,7 @@ // step: functionGrouper // ---- // { -// { -// let x := 2 -// } +// { let x := 2 } // function f() -> y -// { -// y := 8 -// } +// { y := 8 } // } diff --git a/test/libyul/yulOptimizerTests/functionGrouper/empty_block.yul b/test/libyul/yulOptimizerTests/functionGrouper/empty_block.yul index c5a9065de..51699b7a8 100644 --- a/test/libyul/yulOptimizerTests/functionGrouper/empty_block.yul +++ b/test/libyul/yulOptimizerTests/functionGrouper/empty_block.yul @@ -6,20 +6,13 @@ // { // { // let a:u256 -// { -// } +// { } // } // function f() -> x:bool // { // let b:u256 := 4:u256 -// { -// } -// for { -// } -// f() -// { -// } -// { -// } +// { } +// for { } f() { } +// { } // } // } diff --git a/test/libyul/yulOptimizerTests/functionGrouper/grouped_but_not_ordered.yul b/test/libyul/yulOptimizerTests/functionGrouper/grouped_but_not_ordered.yul index f18a4f6a4..4ad0c872d 100644 --- a/test/libyul/yulOptimizerTests/functionGrouper/grouped_but_not_ordered.yul +++ b/test/libyul/yulOptimizerTests/functionGrouper/grouped_but_not_ordered.yul @@ -8,13 +8,7 @@ // step: functionGrouper // ---- // { -// { -// { -// let x := 2 -// } -// } +// { { let x := 2 } } // function f() -> y -// { -// y := 8 -// } +// { y := 8 } // } diff --git a/test/libyul/yulOptimizerTests/functionGrouper/multi_fun_mixed.yul b/test/libyul/yulOptimizerTests/functionGrouper/multi_fun_mixed.yul index 53baf628d..73af943aa 100644 --- a/test/libyul/yulOptimizerTests/functionGrouper/multi_fun_mixed.yul +++ b/test/libyul/yulOptimizerTests/functionGrouper/multi_fun_mixed.yul @@ -15,11 +15,7 @@ // let e:u256 // } // function f() -// { -// let b:u256 -// } +// { let b:u256 } // function g() -// { -// let d:u256 -// } +// { let d:u256 } // } diff --git a/test/libyul/yulOptimizerTests/functionGrouper/nested_fun.yul b/test/libyul/yulOptimizerTests/functionGrouper/nested_fun.yul index 43bd5b1ad..ac67a4461 100644 --- a/test/libyul/yulOptimizerTests/functionGrouper/nested_fun.yul +++ b/test/libyul/yulOptimizerTests/functionGrouper/nested_fun.yul @@ -13,16 +13,12 @@ // yul: true // ---- // { -// { -// let a:u256 -// } +// { let a:u256 } // function f() // { // let b:u256 // function g() -// { -// let c:u256 -// } +// { let c:u256 } // let d:u256 // } // } diff --git a/test/libyul/yulOptimizerTests/functionGrouper/single_fun.yul b/test/libyul/yulOptimizerTests/functionGrouper/single_fun.yul index 15d2ddecf..ec72697a7 100644 --- a/test/libyul/yulOptimizerTests/functionGrouper/single_fun.yul +++ b/test/libyul/yulOptimizerTests/functionGrouper/single_fun.yul @@ -6,10 +6,7 @@ // yul: true // ---- // { -// { -// let a:u256 -// } +// { let a:u256 } // function f() -// { -// } +// { } // } diff --git a/test/libyul/yulOptimizerTests/functionGrouper/smoke.yul b/test/libyul/yulOptimizerTests/functionGrouper/smoke.yul index 285265a4f..00895bf38 100644 --- a/test/libyul/yulOptimizerTests/functionGrouper/smoke.yul +++ b/test/libyul/yulOptimizerTests/functionGrouper/smoke.yul @@ -2,7 +2,4 @@ // ==== // step: functionGrouper // ---- -// { -// { -// } -// } +// { { } } diff --git a/test/libyul/yulOptimizerTests/functionHoister/empty_block.yul b/test/libyul/yulOptimizerTests/functionHoister/empty_block.yul index 3f5ec85a7..4d3b90d45 100644 --- a/test/libyul/yulOptimizerTests/functionHoister/empty_block.yul +++ b/test/libyul/yulOptimizerTests/functionHoister/empty_block.yul @@ -16,12 +16,7 @@ // function f() -> x:bool // { // let b:u256 := 4:u256 -// for { -// } -// f() -// { -// } -// { -// } +// for { } f() { } +// { } // } // } diff --git a/test/libyul/yulOptimizerTests/functionHoister/multi_mixed.yul b/test/libyul/yulOptimizerTests/functionHoister/multi_mixed.yul index 41b263ac0..7d41d59e7 100644 --- a/test/libyul/yulOptimizerTests/functionHoister/multi_mixed.yul +++ b/test/libyul/yulOptimizerTests/functionHoister/multi_mixed.yul @@ -14,11 +14,7 @@ // let c:u256 // let e:u256 // function f() -// { -// let b:u256 -// } +// { let b:u256 } // function g() -// { -// let d:u256 -// } +// { let d:u256 } // } diff --git a/test/libyul/yulOptimizerTests/functionHoister/nested.yul b/test/libyul/yulOptimizerTests/functionHoister/nested.yul index e25bc0cf9..50d962907 100644 --- a/test/libyul/yulOptimizerTests/functionHoister/nested.yul +++ b/test/libyul/yulOptimizerTests/functionHoister/nested.yul @@ -13,9 +13,7 @@ // { // let a:u256 // function g() -// { -// let c:u256 -// } +// { let c:u256 } // function f() // { // let b:u256 diff --git a/test/libyul/yulOptimizerTests/functionHoister/single.yul b/test/libyul/yulOptimizerTests/functionHoister/single.yul index 0366d9a87..70c3ecb3d 100644 --- a/test/libyul/yulOptimizerTests/functionHoister/single.yul +++ b/test/libyul/yulOptimizerTests/functionHoister/single.yul @@ -9,6 +9,5 @@ // { // let a:u256 // function f() -// { -// } +// { } // } diff --git a/test/libyul/yulOptimizerTests/functionHoister/smoke.yul b/test/libyul/yulOptimizerTests/functionHoister/smoke.yul index c730174f3..27c9e8419 100644 --- a/test/libyul/yulOptimizerTests/functionHoister/smoke.yul +++ b/test/libyul/yulOptimizerTests/functionHoister/smoke.yul @@ -3,5 +3,4 @@ // ==== // step: functionHoister // ---- -// { -// } +// { } diff --git a/test/libyul/yulOptimizerTests/mainFunction/empty_block.yul b/test/libyul/yulOptimizerTests/mainFunction/empty_block.yul index cd5876597..efe904d89 100644 --- a/test/libyul/yulOptimizerTests/mainFunction/empty_block.yul +++ b/test/libyul/yulOptimizerTests/mainFunction/empty_block.yul @@ -15,20 +15,13 @@ // function main() // { // let a:u256 -// { -// } +// { } // } // function f() -> x:bool // { // let b:u256 := 4:u256 -// { -// } -// for { -// } -// f() -// { -// } -// { -// } +// { } +// for { } f() { } +// { } // } // } diff --git a/test/libyul/yulOptimizerTests/mainFunction/multi_fun_mixed.yul b/test/libyul/yulOptimizerTests/mainFunction/multi_fun_mixed.yul index e9a2b091e..2f4de38b6 100644 --- a/test/libyul/yulOptimizerTests/mainFunction/multi_fun_mixed.yul +++ b/test/libyul/yulOptimizerTests/mainFunction/multi_fun_mixed.yul @@ -17,11 +17,7 @@ // let e:u256 // } // function f() -// { -// let b:u256 -// } +// { let b:u256 } // function g() -// { -// let d:u256 -// } +// { let d:u256 } // } diff --git a/test/libyul/yulOptimizerTests/mainFunction/nested_fun.yul b/test/libyul/yulOptimizerTests/mainFunction/nested_fun.yul index 8294172b1..2c9d120b3 100644 --- a/test/libyul/yulOptimizerTests/mainFunction/nested_fun.yul +++ b/test/libyul/yulOptimizerTests/mainFunction/nested_fun.yul @@ -12,16 +12,12 @@ // ---- // { // function main() -// { -// let a:u256 -// } +// { let a:u256 } // function f() // { // let b:u256 // function g() -// { -// let c:u256 -// } +// { let c:u256 } // let d:u256 // } // } diff --git a/test/libyul/yulOptimizerTests/mainFunction/sigle_fun.yul b/test/libyul/yulOptimizerTests/mainFunction/sigle_fun.yul index 7a7fc9471..c7de43441 100644 --- a/test/libyul/yulOptimizerTests/mainFunction/sigle_fun.yul +++ b/test/libyul/yulOptimizerTests/mainFunction/sigle_fun.yul @@ -8,10 +8,7 @@ // ---- // { // function main() -// { -// let a:u256 -// } +// { let a:u256 } // function f() -// { -// } +// { } // } diff --git a/test/libyul/yulOptimizerTests/mainFunction/smoke.yul b/test/libyul/yulOptimizerTests/mainFunction/smoke.yul index 156f8849a..3ae7cb5f7 100644 --- a/test/libyul/yulOptimizerTests/mainFunction/smoke.yul +++ b/test/libyul/yulOptimizerTests/mainFunction/smoke.yul @@ -5,6 +5,5 @@ // ---- // { // function main() -// { -// } +// { } // } diff --git a/test/libyul/yulOptimizerTests/redundantAssignEliminator/for.yul b/test/libyul/yulOptimizerTests/redundantAssignEliminator/for.yul index ecddd254c..a7280364f 100644 --- a/test/libyul/yulOptimizerTests/redundantAssignEliminator/for.yul +++ b/test/libyul/yulOptimizerTests/redundantAssignEliminator/for.yul @@ -13,13 +13,6 @@ // { // let a := 2 // a := 3 -// for { -// } -// a -// { -// a := add(a, 1) -// } -// { -// a := 7 -// } +// for { } a { a := add(a, 1) } +// { a := 7 } // } diff --git a/test/libyul/yulOptimizerTests/redundantAssignEliminator/for_branch.yul b/test/libyul/yulOptimizerTests/redundantAssignEliminator/for_branch.yul index cad75ac9e..6b15425c9 100644 --- a/test/libyul/yulOptimizerTests/redundantAssignEliminator/for_branch.yul +++ b/test/libyul/yulOptimizerTests/redundantAssignEliminator/for_branch.yul @@ -20,13 +20,7 @@ // let x // let y // x := 1 -// for { -// } -// calldataload(0) -// { -// } -// { -// x := 2 -// } +// for { } calldataload(0) { } +// { x := 2 } // mstore(x, 0) // } diff --git a/test/libyul/yulOptimizerTests/redundantAssignEliminator/for_break.yul b/test/libyul/yulOptimizerTests/redundantAssignEliminator/for_break.yul index 9a5ce0fef..647de0d24 100644 --- a/test/libyul/yulOptimizerTests/redundantAssignEliminator/for_break.yul +++ b/test/libyul/yulOptimizerTests/redundantAssignEliminator/for_break.yul @@ -18,11 +18,7 @@ // { // let x // x := 1 -// for { -// } -// calldataload(0) -// { -// } +// for { } calldataload(0) { } // { // if callvalue() // { diff --git a/test/libyul/yulOptimizerTests/redundantAssignEliminator/for_continue.yul b/test/libyul/yulOptimizerTests/redundantAssignEliminator/for_continue.yul index 7242bd37b..3ac614b67 100644 --- a/test/libyul/yulOptimizerTests/redundantAssignEliminator/for_continue.yul +++ b/test/libyul/yulOptimizerTests/redundantAssignEliminator/for_continue.yul @@ -20,17 +20,10 @@ // ---- // { // let x -// for { -// } -// calldataload(0) -// { -// } +// for { } calldataload(0) { } // { // x := 2 -// if callvalue() -// { -// continue -// } +// if callvalue() { continue } // mstore(x, 2) // } // } diff --git a/test/libyul/yulOptimizerTests/redundantAssignEliminator/for_continue_2.yul b/test/libyul/yulOptimizerTests/redundantAssignEliminator/for_continue_2.yul index 61138df4a..ab7ba0df1 100644 --- a/test/libyul/yulOptimizerTests/redundantAssignEliminator/for_continue_2.yul +++ b/test/libyul/yulOptimizerTests/redundantAssignEliminator/for_continue_2.yul @@ -18,11 +18,7 @@ // { // let x // x := 1 -// for { -// } -// calldataload(0) -// { -// } +// for { } calldataload(0) { } // { // if callvalue() // { diff --git a/test/libyul/yulOptimizerTests/redundantAssignEliminator/for_continue_3.yul b/test/libyul/yulOptimizerTests/redundantAssignEliminator/for_continue_3.yul index 286be48dd..14faa2a75 100644 --- a/test/libyul/yulOptimizerTests/redundantAssignEliminator/for_continue_3.yul +++ b/test/libyul/yulOptimizerTests/redundantAssignEliminator/for_continue_3.yul @@ -16,12 +16,7 @@ // ---- // { // let x -// for { -// } -// calldataload(0) -// { -// mstore(x, 0x42) -// } +// for { } calldataload(0) { mstore(x, 0x42) } // { // if callvalue() // { diff --git a/test/libyul/yulOptimizerTests/redundantAssignEliminator/for_decl_inside_break_continue.yul b/test/libyul/yulOptimizerTests/redundantAssignEliminator/for_decl_inside_break_continue.yul index 70ace5f4b..87104647d 100644 --- a/test/libyul/yulOptimizerTests/redundantAssignEliminator/for_decl_inside_break_continue.yul +++ b/test/libyul/yulOptimizerTests/redundantAssignEliminator/for_decl_inside_break_continue.yul @@ -23,22 +23,12 @@ // ---- // { // let x := 1 -// for { -// } -// calldataload(0) -// { -// } +// for { } calldataload(0) { } // { // { // let y := 9 -// if callvalue() -// { -// break -// } -// if eq(callvalue(), 3) -// { -// continue -// } +// if callvalue() { break } +// if eq(callvalue(), 3) { continue } // } // } // mstore(x, 0x42) diff --git a/test/libyul/yulOptimizerTests/redundantAssignEliminator/for_deep_noremove.yul b/test/libyul/yulOptimizerTests/redundantAssignEliminator/for_deep_noremove.yul index b9bbc6d47..96571f435 100644 --- a/test/libyul/yulOptimizerTests/redundantAssignEliminator/for_deep_noremove.yul +++ b/test/libyul/yulOptimizerTests/redundantAssignEliminator/for_deep_noremove.yul @@ -33,48 +33,19 @@ // let y := 2 // let a := 3 // let b := 4 -// for { -// } -// 1 +// for { } 1 { } // { -// } -// { -// for { -// } -// 1 +// for { } 1 { } // { -// } -// { -// for { -// } -// 1 +// for { } 1 { } // { -// } -// { -// for { -// } -// 1 +// for { } 1 { } // { -// } -// { -// for { -// } -// 1 +// for { } 1 { } // { -// } -// { -// for { -// } -// 1 +// for { } 1 { } // { -// } -// { -// for { -// } -// 1 -// { -// a := 10 -// } +// for { } 1 { a := 10 } // { // b := 12 // b := 11 diff --git a/test/libyul/yulOptimizerTests/redundantAssignEliminator/for_deep_simple.yul b/test/libyul/yulOptimizerTests/redundantAssignEliminator/for_deep_simple.yul index 716674b8d..6df6e33ef 100644 --- a/test/libyul/yulOptimizerTests/redundantAssignEliminator/for_deep_simple.yul +++ b/test/libyul/yulOptimizerTests/redundantAssignEliminator/for_deep_simple.yul @@ -22,51 +22,20 @@ // step: redundantAssignEliminator // ---- // { -// for { -// } -// 1 +// for { } 1 { } // { -// } -// { -// for { -// } -// 1 +// for { } 1 { } // { -// } -// { -// for { -// } -// 1 +// for { } 1 { } // { -// } -// { -// for { -// } -// 1 +// for { } 1 { } // { -// } -// { -// for { -// } -// 1 +// for { } 1 { } // { -// } -// { -// for { -// } -// 1 +// for { } 1 { } // { -// } -// { -// for { -// } -// 1 -// { -// let a := 1 -// } -// { -// let b := 1 -// } +// for { } 1 { let a := 1 } +// { let b := 1 } // } // } // } diff --git a/test/libyul/yulOptimizerTests/redundantAssignEliminator/for_multi_break.yul b/test/libyul/yulOptimizerTests/redundantAssignEliminator/for_multi_break.yul index 6d5be5741..5b0e70f8c 100644 --- a/test/libyul/yulOptimizerTests/redundantAssignEliminator/for_multi_break.yul +++ b/test/libyul/yulOptimizerTests/redundantAssignEliminator/for_multi_break.yul @@ -41,8 +41,7 @@ // let x := 1 // let y := 1 // let z := 1 -// for { -// } +// for { } // calldataload(0) // { // mstore(x, 2) diff --git a/test/libyul/yulOptimizerTests/redundantAssignEliminator/for_nested.yul b/test/libyul/yulOptimizerTests/redundantAssignEliminator/for_nested.yul index 067a999cc..7e9518f89 100644 --- a/test/libyul/yulOptimizerTests/redundantAssignEliminator/for_nested.yul +++ b/test/libyul/yulOptimizerTests/redundantAssignEliminator/for_nested.yul @@ -39,22 +39,14 @@ // let y := 1 // let a := 7 // let b := 9 -// for { -// } -// calldataload(0) -// { -// } +// for { } calldataload(0) { } // { // y := 9 // mstore(a, 7) // if callvalue() // { // x := 2 -// for { -// } -// calldataload(1) -// { -// } +// for { } calldataload(1) { } // { // if eq(x, 3) // { diff --git a/test/libyul/yulOptimizerTests/redundantAssignEliminator/for_rerun.yul b/test/libyul/yulOptimizerTests/redundantAssignEliminator/for_rerun.yul index d9da624d6..3cf202582 100644 --- a/test/libyul/yulOptimizerTests/redundantAssignEliminator/for_rerun.yul +++ b/test/libyul/yulOptimizerTests/redundantAssignEliminator/for_rerun.yul @@ -16,11 +16,7 @@ // { // let x // x := 1 -// for { -// } -// calldataload(0) -// { -// } +// for { } calldataload(0) { } // { // mstore(x, 2) // x := 2 diff --git a/test/libyul/yulOptimizerTests/redundantAssignEliminator/for_stmnts_after_break_continue.yul b/test/libyul/yulOptimizerTests/redundantAssignEliminator/for_stmnts_after_break_continue.yul index aded61cda..eceba8c23 100644 --- a/test/libyul/yulOptimizerTests/redundantAssignEliminator/for_stmnts_after_break_continue.yul +++ b/test/libyul/yulOptimizerTests/redundantAssignEliminator/for_stmnts_after_break_continue.yul @@ -28,11 +28,7 @@ // { // let x := 1 // let y := 1 -// for { -// } -// calldataload(0) -// { -// } +// for { } calldataload(0) { } // { // y := 9 // if callvalue() diff --git a/test/libyul/yulOptimizerTests/redundantAssignEliminator/if.yul b/test/libyul/yulOptimizerTests/redundantAssignEliminator/if.yul index 69c41c0be..35b6c968f 100644 --- a/test/libyul/yulOptimizerTests/redundantAssignEliminator/if.yul +++ b/test/libyul/yulOptimizerTests/redundantAssignEliminator/if.yul @@ -17,9 +17,6 @@ // let d // c := calldataload(0) // d := 1 -// if c -// { -// d := 2 -// } +// if c { d := 2 } // mstore(0, d) // } diff --git a/test/libyul/yulOptimizerTests/redundantAssignEliminator/if_overwrite_all_branches.yul b/test/libyul/yulOptimizerTests/redundantAssignEliminator/if_overwrite_all_branches.yul index de9d4dc0a..120c3e07b 100644 --- a/test/libyul/yulOptimizerTests/redundantAssignEliminator/if_overwrite_all_branches.yul +++ b/test/libyul/yulOptimizerTests/redundantAssignEliminator/if_overwrite_all_branches.yul @@ -17,9 +17,7 @@ // let c // let d // c := calldataload(0) -// if c -// { -// } +// if c { } // d := 3 // mstore(0, d) // } diff --git a/test/libyul/yulOptimizerTests/redundantAssignEliminator/if_used_in_one_branch.yul b/test/libyul/yulOptimizerTests/redundantAssignEliminator/if_used_in_one_branch.yul index 653446aae..9fadcbbe9 100644 --- a/test/libyul/yulOptimizerTests/redundantAssignEliminator/if_used_in_one_branch.yul +++ b/test/libyul/yulOptimizerTests/redundantAssignEliminator/if_used_in_one_branch.yul @@ -18,9 +18,7 @@ // let d // c := calldataload(0) // d := 1 -// if c -// { -// } +// if c { } // d := 3 // mstore(0, d) // } diff --git a/test/libyul/yulOptimizerTests/redundantAssignEliminator/multi_assign.yul b/test/libyul/yulOptimizerTests/redundantAssignEliminator/multi_assign.yul index 918eb89df..b4546aa55 100644 --- a/test/libyul/yulOptimizerTests/redundantAssignEliminator/multi_assign.yul +++ b/test/libyul/yulOptimizerTests/redundantAssignEliminator/multi_assign.yul @@ -13,8 +13,7 @@ // ---- // { // function f() -> a, b -// { -// } +// { } // let x, y // x, y := f() // } diff --git a/test/libyul/yulOptimizerTests/redundantAssignEliminator/scopes.yul b/test/libyul/yulOptimizerTests/redundantAssignEliminator/scopes.yul index 7d6afaf02..85c83bde8 100644 --- a/test/libyul/yulOptimizerTests/redundantAssignEliminator/scopes.yul +++ b/test/libyul/yulOptimizerTests/redundantAssignEliminator/scopes.yul @@ -11,7 +11,5 @@ // ---- // { // let a -// { -// let b -// } +// { let b } // } diff --git a/test/libyul/yulOptimizerTests/redundantAssignEliminator/simple.yul b/test/libyul/yulOptimizerTests/redundantAssignEliminator/simple.yul index e05823ac8..1fd827ed1 100644 --- a/test/libyul/yulOptimizerTests/redundantAssignEliminator/simple.yul +++ b/test/libyul/yulOptimizerTests/redundantAssignEliminator/simple.yul @@ -6,6 +6,4 @@ // ==== // step: redundantAssignEliminator // ---- -// { -// let a -// } +// { let a } diff --git a/test/libyul/yulOptimizerTests/redundantAssignEliminator/switch_overwrite_in_all.yul b/test/libyul/yulOptimizerTests/redundantAssignEliminator/switch_overwrite_in_all.yul index 1df661d1a..547ae025b 100644 --- a/test/libyul/yulOptimizerTests/redundantAssignEliminator/switch_overwrite_in_all.yul +++ b/test/libyul/yulOptimizerTests/redundantAssignEliminator/switch_overwrite_in_all.yul @@ -13,11 +13,7 @@ // { // let x // switch calldataload(0) -// case 0 { -// x := 2 -// } -// default { -// x := 3 -// } +// case 0 { x := 2 } +// default { x := 3 } // mstore(x, 0) // } diff --git a/test/libyul/yulOptimizerTests/redundantAssignEliminator/switch_overwrite_in_one.yul b/test/libyul/yulOptimizerTests/redundantAssignEliminator/switch_overwrite_in_one.yul index 47bc9ff46..7ab2036e1 100644 --- a/test/libyul/yulOptimizerTests/redundantAssignEliminator/switch_overwrite_in_one.yul +++ b/test/libyul/yulOptimizerTests/redundantAssignEliminator/switch_overwrite_in_one.yul @@ -13,8 +13,6 @@ // let x // x := 1 // switch calldataload(0) -// case 0 { -// x := 2 -// } +// case 0 { x := 2 } // mstore(x, 0) // } diff --git a/test/libyul/yulOptimizerTests/redundantAssignEliminator/switch_overwrite_use_combination.yul b/test/libyul/yulOptimizerTests/redundantAssignEliminator/switch_overwrite_use_combination.yul index 25c360531..8dc43d721 100644 --- a/test/libyul/yulOptimizerTests/redundantAssignEliminator/switch_overwrite_use_combination.yul +++ b/test/libyul/yulOptimizerTests/redundantAssignEliminator/switch_overwrite_use_combination.yul @@ -14,11 +14,7 @@ // let x // x := 1 // switch calldataload(0) -// case 0 { -// x := 2 -// } -// default { -// mstore(x, 1) -// } +// case 0 { x := 2 } +// default { mstore(x, 1) } // mstore(x, 0) // } diff --git a/test/libyul/yulOptimizerTests/redundantAssignEliminator/switch_unused.yul b/test/libyul/yulOptimizerTests/redundantAssignEliminator/switch_unused.yul index c45eb8423..f0b29f301 100644 --- a/test/libyul/yulOptimizerTests/redundantAssignEliminator/switch_unused.yul +++ b/test/libyul/yulOptimizerTests/redundantAssignEliminator/switch_unused.yul @@ -11,7 +11,5 @@ // { // let x // switch calldataload(0) -// case 0 { -// mstore(0, 1) -// } +// case 0 { mstore(0, 1) } // } diff --git a/test/libyul/yulOptimizerTests/rematerialiser/branches_for1.yul b/test/libyul/yulOptimizerTests/rematerialiser/branches_for1.yul index bd24b0903..520c87b92 100644 --- a/test/libyul/yulOptimizerTests/rematerialiser/branches_for1.yul +++ b/test/libyul/yulOptimizerTests/rematerialiser/branches_for1.yul @@ -11,13 +11,6 @@ // { // let a := caller() // pop(caller()) -// for { -// } -// caller() -// { -// pop(caller()) -// } -// { -// pop(caller()) -// } +// for { } caller() { pop(caller()) } +// { pop(caller()) } // } diff --git a/test/libyul/yulOptimizerTests/rematerialiser/branches_for2.yul b/test/libyul/yulOptimizerTests/rematerialiser/branches_for2.yul index a7325ecef..4dd86f958 100644 --- a/test/libyul/yulOptimizerTests/rematerialiser/branches_for2.yul +++ b/test/libyul/yulOptimizerTests/rematerialiser/branches_for2.yul @@ -13,12 +13,7 @@ // { // let a := caller() // pop(caller()) -// for { -// } -// a -// { -// pop(address()) -// } +// for { } a { pop(address()) } // { // a := address() // let c := address() diff --git a/test/libyul/yulOptimizerTests/rematerialiser/branches_switch.yul b/test/libyul/yulOptimizerTests/rematerialiser/branches_switch.yul index 71a3a2c75..e0aa0a385 100644 --- a/test/libyul/yulOptimizerTests/rematerialiser/branches_switch.yul +++ b/test/libyul/yulOptimizerTests/rematerialiser/branches_switch.yul @@ -13,9 +13,7 @@ // let a := 1 // let b := 2 // switch number() -// case 1 { -// b := 1 -// } +// case 1 { b := 1 } // default { // let x := 1 // let y := b diff --git a/test/libyul/yulOptimizerTests/rematerialiser/for_break.yul b/test/libyul/yulOptimizerTests/rematerialiser/for_break.yul index b9ec6f2a2..e39b66b44 100644 --- a/test/libyul/yulOptimizerTests/rematerialiser/for_break.yul +++ b/test/libyul/yulOptimizerTests/rematerialiser/for_break.yul @@ -20,20 +20,12 @@ // let a // let b // let i := 0 -// for { -// } -// lt(i, 10) -// { -// i := add(caller(), caller()) -// } +// for { } lt(i, 10) { i := add(caller(), caller()) } // { // a := origin() // b := origin() // b := caller() -// if callvalue() -// { -// break -// } +// if callvalue() { break } // a := caller() // } // mstore(a, b) diff --git a/test/libyul/yulOptimizerTests/rematerialiser/for_continue.yul b/test/libyul/yulOptimizerTests/rematerialiser/for_continue.yul index baf4c09e0..5a98c4c4d 100644 --- a/test/libyul/yulOptimizerTests/rematerialiser/for_continue.yul +++ b/test/libyul/yulOptimizerTests/rematerialiser/for_continue.yul @@ -22,20 +22,12 @@ // let a // let b // let i := 0 -// for { -// } -// lt(i, 10) -// { -// i := add(a, caller()) -// } +// for { } lt(i, 10) { i := add(a, caller()) } // { // a := origin() // b := origin() // b := caller() -// if callvalue() -// { -// continue -// } +// if callvalue() { continue } // a := caller() // } // mstore(a, b) diff --git a/test/libyul/yulOptimizerTests/rematerialiser/for_continue_2.yul b/test/libyul/yulOptimizerTests/rematerialiser/for_continue_2.yul index 6e946660c..f01514cc5 100644 --- a/test/libyul/yulOptimizerTests/rematerialiser/for_continue_2.yul +++ b/test/libyul/yulOptimizerTests/rematerialiser/for_continue_2.yul @@ -28,26 +28,15 @@ // let b // let c // let i := 0 -// for { -// } -// lt(i, 10) -// { -// i := add(add(a, caller()), c) -// } +// for { } lt(i, 10) { i := add(add(a, caller()), c) } // { // a := origin() // b := origin() // c := origin() // b := caller() -// if callvalue() -// { -// continue -// } +// if callvalue() { continue } // a := caller() -// if callvalue() -// { -// continue -// } +// if callvalue() { continue } // c := caller() // } // mstore(a, b) diff --git a/test/libyul/yulOptimizerTests/rematerialiser/for_continue_with_assignment_in_post.yul b/test/libyul/yulOptimizerTests/rematerialiser/for_continue_with_assignment_in_post.yul index 325dd2284..ae04949d9 100644 --- a/test/libyul/yulOptimizerTests/rematerialiser/for_continue_with_assignment_in_post.yul +++ b/test/libyul/yulOptimizerTests/rematerialiser/for_continue_with_assignment_in_post.yul @@ -33,8 +33,7 @@ // let i := 0 // b := origin() // c := origin() -// for { -// } +// for { } // lt(i, 10) // { // i := add(a, caller()) @@ -44,10 +43,7 @@ // { // a := origin() // b := caller() -// if callvalue() -// { -// continue -// } +// if callvalue() { continue } // a := caller() // } // let x := b diff --git a/test/libyul/yulOptimizerTests/rematerialiser/non_movable_function.yul b/test/libyul/yulOptimizerTests/rematerialiser/non_movable_function.yul index 663c70ca9..1b59fd598 100644 --- a/test/libyul/yulOptimizerTests/rematerialiser/non_movable_function.yul +++ b/test/libyul/yulOptimizerTests/rematerialiser/non_movable_function.yul @@ -10,8 +10,7 @@ // ---- // { // function f(x) -> y -// { -// } +// { } // let a := 1 // let b := f(1) // let c := 1 diff --git a/test/libyul/yulOptimizerTests/rematerialiser/reassignment.yul b/test/libyul/yulOptimizerTests/rematerialiser/reassignment.yul index 28709ac1f..c10f9ddf2 100644 --- a/test/libyul/yulOptimizerTests/rematerialiser/reassignment.yul +++ b/test/libyul/yulOptimizerTests/rematerialiser/reassignment.yul @@ -11,10 +11,7 @@ // { // let a := 1 // pop(1) -// if 1 -// { -// a := 2 -// } +// if 1 { a := 2 } // let b := mload(a) // pop(b) // } diff --git a/test/libyul/yulOptimizerTests/rematerialiser/smoke.yul b/test/libyul/yulOptimizerTests/rematerialiser/smoke.yul index ae0286f90..e0452c4b8 100644 --- a/test/libyul/yulOptimizerTests/rematerialiser/smoke.yul +++ b/test/libyul/yulOptimizerTests/rematerialiser/smoke.yul @@ -2,5 +2,4 @@ // ==== // step: rematerialiser // ---- -// { -// } +// { } diff --git a/test/libyul/yulOptimizerTests/splitJoin/control_flow.yul b/test/libyul/yulOptimizerTests/splitJoin/control_flow.yul index a87fe4fd0..7e60a54be 100644 --- a/test/libyul/yulOptimizerTests/splitJoin/control_flow.yul +++ b/test/libyul/yulOptimizerTests/splitJoin/control_flow.yul @@ -12,13 +12,7 @@ // { // if mul(add(calldataload(0), 2), 3) // { -// for { -// let a := 2 -// } -// lt(a, mload(a)) -// { -// a := add(a, mul(a, 2)) -// } +// for { let a := 2 } lt(a, mload(a)) { a := add(a, mul(a, 2)) } // { // let b := mul(add(a, 2), 4) // sstore(b, mul(b, 2)) diff --git a/test/libyul/yulOptimizerTests/splitJoin/functions.yul b/test/libyul/yulOptimizerTests/splitJoin/functions.yul index 12bbe4cfb..b4ad9ed8e 100644 --- a/test/libyul/yulOptimizerTests/splitJoin/functions.yul +++ b/test/libyul/yulOptimizerTests/splitJoin/functions.yul @@ -17,13 +17,7 @@ // { // r := mload(mul(6, add(y, 0x20))) // } -// for { -// let a := 2 -// } -// lt(a, mload(a)) -// { -// a := add(a, mul(a, 2)) -// } +// for { let a := 2 } lt(a, mload(a)) { a := add(a, mul(a, 2)) } // { // let b := mul(add(a, f(a)), 4) // sstore(b, mul(b, 2)) diff --git a/test/libyul/yulOptimizerTests/splitJoin/smoke.yul b/test/libyul/yulOptimizerTests/splitJoin/smoke.yul index 073663ff4..d59bd5644 100644 --- a/test/libyul/yulOptimizerTests/splitJoin/smoke.yul +++ b/test/libyul/yulOptimizerTests/splitJoin/smoke.yul @@ -2,5 +2,4 @@ // ==== // step: splitJoin // ---- -// { -// } +// { } diff --git a/test/libyul/yulOptimizerTests/ssaAndBack/for_loop.yul b/test/libyul/yulOptimizerTests/ssaAndBack/for_loop.yul index 99d3d56e5..c556fbd8f 100644 --- a/test/libyul/yulOptimizerTests/ssaAndBack/for_loop.yul +++ b/test/libyul/yulOptimizerTests/ssaAndBack/for_loop.yul @@ -21,12 +21,7 @@ // { // let a := mload(0) // let b := mload(1) -// for { -// } -// lt(mload(a), mload(b)) -// { -// a := mload(b) -// } +// for { } lt(mload(a), mload(b)) { a := mload(b) } // { // let b_3 := mload(a) // pop(mload(b_3)) diff --git a/test/libyul/yulOptimizerTests/ssaAndBack/single_assign_if.yul b/test/libyul/yulOptimizerTests/ssaAndBack/single_assign_if.yul index 04faa44dc..0e777a5a5 100644 --- a/test/libyul/yulOptimizerTests/ssaAndBack/single_assign_if.yul +++ b/test/libyul/yulOptimizerTests/ssaAndBack/single_assign_if.yul @@ -11,9 +11,6 @@ // ---- // { // let a := mload(0) -// if mload(1) -// { -// a := mload(1) -// } +// if mload(1) { a := mload(1) } // mstore(a, 0) // } diff --git a/test/libyul/yulOptimizerTests/ssaAndBack/single_assign_switch.yul b/test/libyul/yulOptimizerTests/ssaAndBack/single_assign_switch.yul index d31fb549a..aacad246a 100644 --- a/test/libyul/yulOptimizerTests/ssaAndBack/single_assign_switch.yul +++ b/test/libyul/yulOptimizerTests/ssaAndBack/single_assign_switch.yul @@ -15,11 +15,7 @@ // { // let a := mload(0) // switch mload(1) -// case 0 { -// a := mload(1) -// } -// default { -// a := mload(2) -// } +// case 0 { a := mload(1) } +// default { a := mload(2) } // mstore(a, 0) // } diff --git a/test/libyul/yulOptimizerTests/ssaAndBack/ssaReverse.yul b/test/libyul/yulOptimizerTests/ssaAndBack/ssaReverse.yul index f14b1fe32..fbb149c68 100644 --- a/test/libyul/yulOptimizerTests/ssaAndBack/ssaReverse.yul +++ b/test/libyul/yulOptimizerTests/ssaAndBack/ssaReverse.yul @@ -36,10 +36,7 @@ // revert(arrayPos_14, arrayPos_14) // } // arrayPos_14 := add(offset_12, 0x20) -// if gt(add(add(offset_12, length_15), 0x20), end_13) -// { -// revert(0, 0) -// } +// if gt(add(add(offset_12, length_15), 0x20), end_13) { revert(0, 0) } // } // let a, b := abi_decode_t_bytes_calldata_ptr(mload(0), mload(1)) // mstore(a, b) diff --git a/test/libyul/yulOptimizerTests/ssaPlusCleanup/control_structures.yul b/test/libyul/yulOptimizerTests/ssaPlusCleanup/control_structures.yul index e4f06a781..501737088 100644 --- a/test/libyul/yulOptimizerTests/ssaPlusCleanup/control_structures.yul +++ b/test/libyul/yulOptimizerTests/ssaPlusCleanup/control_structures.yul @@ -23,8 +23,7 @@ // let to_3 := add(to, 0x20) // let x_4 := 1 // let x := x_4 -// for { -// } +// for { } // lt(x, length_1) // { // let x_5 := add(x, 0x20) diff --git a/test/libyul/yulOptimizerTests/ssaReverser/abi_example.yul b/test/libyul/yulOptimizerTests/ssaReverser/abi_example.yul index 32e05ad35..18d404df0 100644 --- a/test/libyul/yulOptimizerTests/ssaReverser/abi_example.yul +++ b/test/libyul/yulOptimizerTests/ssaReverser/abi_example.yul @@ -25,21 +25,12 @@ // { // function abi_decode_t_bytes_calldata_ptr(offset_12, end_13) -> arrayPos_14, length_15 // { -// if iszero(slt(add(offset_12, 0x1f), end_13)) -// { -// revert(0, 0) -// } +// if iszero(slt(add(offset_12, 0x1f), end_13)) { revert(0, 0) } // length_15 := calldataload(offset_12) // let length_15_1 := length_15 -// if gt(length_15_1, 0xffffffffffffffff) -// { -// revert(0, 0) -// } +// if gt(length_15_1, 0xffffffffffffffff) { revert(0, 0) } // arrayPos_14 := add(offset_12, 0x20) // let arrayPos_14_2 := arrayPos_14 -// if gt(add(arrayPos_14_2, mul(length_15_1, 0x1)), end_13) -// { -// revert(0, 0) -// } +// if gt(add(arrayPos_14_2, mul(length_15_1, 0x1)), end_13) { revert(0, 0) } // } // } diff --git a/test/libyul/yulOptimizerTests/ssaTransform/for_reassign_body.yul b/test/libyul/yulOptimizerTests/ssaTransform/for_reassign_body.yul index b16257401..3e7fe480e 100644 --- a/test/libyul/yulOptimizerTests/ssaTransform/for_reassign_body.yul +++ b/test/libyul/yulOptimizerTests/ssaTransform/for_reassign_body.yul @@ -12,13 +12,7 @@ // { // let a_1 := mload(0) // let a := a_1 -// for { -// mstore(0, a_1) -// } -// a -// { -// mstore(0, a) -// } +// for { mstore(0, a_1) } a { mstore(0, a) } // { // let a_2 := add(a, 3) // a := a_2 diff --git a/test/libyul/yulOptimizerTests/ssaTransform/for_reassign_init.yul b/test/libyul/yulOptimizerTests/ssaTransform/for_reassign_init.yul index 8796453d0..eeb1cc182 100644 --- a/test/libyul/yulOptimizerTests/ssaTransform/for_reassign_init.yul +++ b/test/libyul/yulOptimizerTests/ssaTransform/for_reassign_init.yul @@ -17,11 +17,7 @@ // a := a_2 // } // a -// { -// mstore(0, a) -// } -// { -// mstore(0, a) -// } +// { mstore(0, a) } +// { mstore(0, a) } // mstore(0, a) // } diff --git a/test/libyul/yulOptimizerTests/ssaTransform/for_reassign_post.yul b/test/libyul/yulOptimizerTests/ssaTransform/for_reassign_post.yul index cd34f2c8d..bd174c2f0 100644 --- a/test/libyul/yulOptimizerTests/ssaTransform/for_reassign_post.yul +++ b/test/libyul/yulOptimizerTests/ssaTransform/for_reassign_post.yul @@ -12,16 +12,12 @@ // { // let a_1 := mload(0) // let a := a_1 -// for { -// mstore(0, a_1) -// } +// for { mstore(0, a_1) } // a // { // let a_2 := add(a, 3) // a := a_2 // } -// { -// mstore(0, a) -// } +// { mstore(0, a) } // mstore(0, a) // } diff --git a/test/libyul/yulOptimizerTests/ssaTransform/multi_assign.yul b/test/libyul/yulOptimizerTests/ssaTransform/multi_assign.yul index 41905cc79..4f1c44123 100644 --- a/test/libyul/yulOptimizerTests/ssaTransform/multi_assign.yul +++ b/test/libyul/yulOptimizerTests/ssaTransform/multi_assign.yul @@ -24,6 +24,5 @@ // let b_6 := mload(a_5) // b := b_6 // function f() -> x, y -// { -// } +// { } // } diff --git a/test/libyul/yulOptimizerTests/ssaTransform/multi_decl.yul b/test/libyul/yulOptimizerTests/ssaTransform/multi_decl.yul index 4f5949c8e..ea849ead9 100644 --- a/test/libyul/yulOptimizerTests/ssaTransform/multi_decl.yul +++ b/test/libyul/yulOptimizerTests/ssaTransform/multi_decl.yul @@ -20,6 +20,5 @@ // let a, b := f(x_3, y_4) // sstore(a, b) // function f(t, v) -> w, z -// { -// } +// { } // } diff --git a/test/libyul/yulOptimizerTests/stackCompressor/noInline.yul b/test/libyul/yulOptimizerTests/stackCompressor/noInline.yul index e70bb9dc3..39c46fb96 100644 --- a/test/libyul/yulOptimizerTests/stackCompressor/noInline.yul +++ b/test/libyul/yulOptimizerTests/stackCompressor/noInline.yul @@ -8,7 +8,5 @@ // { // let x := 8 // function f() -// { -// let y := 9 -// } +// { let y := 9 } // } diff --git a/test/libyul/yulOptimizerTests/structuralSimplifier/bugfix_visit_after_change.yul b/test/libyul/yulOptimizerTests/structuralSimplifier/bugfix_visit_after_change.yul index 4f4d445ac..f180d50ad 100644 --- a/test/libyul/yulOptimizerTests/structuralSimplifier/bugfix_visit_after_change.yul +++ b/test/libyul/yulOptimizerTests/structuralSimplifier/bugfix_visit_after_change.yul @@ -9,6 +9,4 @@ // ==== // step: structuralSimplifier // ---- -// { -// let x := 0 -// } +// { let x := 0 } diff --git a/test/libyul/yulOptimizerTests/structuralSimplifier/empty_if_non_movable_condition.yul b/test/libyul/yulOptimizerTests/structuralSimplifier/empty_if_non_movable_condition.yul index 70257e03a..5059f6687 100644 --- a/test/libyul/yulOptimizerTests/structuralSimplifier/empty_if_non_movable_condition.yul +++ b/test/libyul/yulOptimizerTests/structuralSimplifier/empty_if_non_movable_condition.yul @@ -2,6 +2,4 @@ // ==== // step: structuralSimplifier // ---- -// { -// pop(mload(0)) -// } +// { pop(mload(0)) } diff --git a/test/libyul/yulOptimizerTests/structuralSimplifier/for_false_condition.sol b/test/libyul/yulOptimizerTests/structuralSimplifier/for_false_condition.sol index 5c4faebf2..0d352a3f9 100644 --- a/test/libyul/yulOptimizerTests/structuralSimplifier/for_false_condition.sol +++ b/test/libyul/yulOptimizerTests/structuralSimplifier/for_false_condition.sol @@ -6,6 +6,4 @@ // ==== // step: structuralSimplifier // ---- -// { -// let a := 42 -// } +// { let a := 42 } diff --git a/test/libyul/yulOptimizerTests/structuralSimplifier/if_false_condition.yul b/test/libyul/yulOptimizerTests/structuralSimplifier/if_false_condition.yul index 59dbcaf2c..ab08b18e8 100644 --- a/test/libyul/yulOptimizerTests/structuralSimplifier/if_false_condition.yul +++ b/test/libyul/yulOptimizerTests/structuralSimplifier/if_false_condition.yul @@ -2,5 +2,4 @@ // ==== // step: structuralSimplifier // ---- -// { -// } +// { } diff --git a/test/libyul/yulOptimizerTests/structuralSimplifier/if_multi_unassigned_condition.yul b/test/libyul/yulOptimizerTests/structuralSimplifier/if_multi_unassigned_condition.yul index efd21db5f..836b4371c 100644 --- a/test/libyul/yulOptimizerTests/structuralSimplifier/if_multi_unassigned_condition.yul +++ b/test/libyul/yulOptimizerTests/structuralSimplifier/if_multi_unassigned_condition.yul @@ -6,6 +6,4 @@ // ==== // step: structuralSimplifier // ---- -// { -// let x, y -// } +// { let x, y } diff --git a/test/libyul/yulOptimizerTests/structuralSimplifier/if_true_condition.yul b/test/libyul/yulOptimizerTests/structuralSimplifier/if_true_condition.yul index 962eff9e2..7d493efbc 100644 --- a/test/libyul/yulOptimizerTests/structuralSimplifier/if_true_condition.yul +++ b/test/libyul/yulOptimizerTests/structuralSimplifier/if_true_condition.yul @@ -2,6 +2,4 @@ // ==== // step: structuralSimplifier // ---- -// { -// mstore(0, 0) -// } +// { mstore(0, 0) } diff --git a/test/libyul/yulOptimizerTests/structuralSimplifier/if_unassigned_condition.yul b/test/libyul/yulOptimizerTests/structuralSimplifier/if_unassigned_condition.yul index aefdb7869..4595fe899 100644 --- a/test/libyul/yulOptimizerTests/structuralSimplifier/if_unassigned_condition.yul +++ b/test/libyul/yulOptimizerTests/structuralSimplifier/if_unassigned_condition.yul @@ -5,6 +5,4 @@ // ==== // step: structuralSimplifier // ---- -// { -// let x -// } +// { let x } diff --git a/test/libyul/yulOptimizerTests/structuralSimplifier/nested.yul b/test/libyul/yulOptimizerTests/structuralSimplifier/nested.yul index 5fe6bdce4..6783b6eee 100644 --- a/test/libyul/yulOptimizerTests/structuralSimplifier/nested.yul +++ b/test/libyul/yulOptimizerTests/structuralSimplifier/nested.yul @@ -2,6 +2,4 @@ // ==== // step: structuralSimplifier // ---- -// { -// mstore(0, 0) -// } +// { mstore(0, 0) } diff --git a/test/libyul/yulOptimizerTests/structuralSimplifier/switch_inline.yul b/test/libyul/yulOptimizerTests/structuralSimplifier/switch_inline.yul index 2476afc94..b80d4ea99 100644 --- a/test/libyul/yulOptimizerTests/structuralSimplifier/switch_inline.yul +++ b/test/libyul/yulOptimizerTests/structuralSimplifier/switch_inline.yul @@ -9,7 +9,5 @@ // ---- // { // let y := 200 -// { -// y := 9 -// } +// { y := 9 } // } diff --git a/test/libyul/yulOptimizerTests/structuralSimplifier/switch_inline_match_default.yul b/test/libyul/yulOptimizerTests/structuralSimplifier/switch_inline_match_default.yul index edc9cb379..5e985d78e 100644 --- a/test/libyul/yulOptimizerTests/structuralSimplifier/switch_inline_match_default.yul +++ b/test/libyul/yulOptimizerTests/structuralSimplifier/switch_inline_match_default.yul @@ -10,7 +10,5 @@ // ---- // { // let y := 200 -// { -// y := 10 -// } +// { y := 10 } // } diff --git a/test/libyul/yulOptimizerTests/structuralSimplifier/switch_inline_no_match.yul b/test/libyul/yulOptimizerTests/structuralSimplifier/switch_inline_no_match.yul index 04b473600..584bbb73d 100644 --- a/test/libyul/yulOptimizerTests/structuralSimplifier/switch_inline_no_match.yul +++ b/test/libyul/yulOptimizerTests/structuralSimplifier/switch_inline_no_match.yul @@ -7,6 +7,4 @@ // ==== // step: structuralSimplifier // ---- -// { -// let y := 200 -// } +// { let y := 200 } diff --git a/test/libyul/yulOptimizerTests/structuralSimplifier/switch_inline_no_match_mixed.yul b/test/libyul/yulOptimizerTests/structuralSimplifier/switch_inline_no_match_mixed.yul index 9c9fd5eba..0dea12292 100644 --- a/test/libyul/yulOptimizerTests/structuralSimplifier/switch_inline_no_match_mixed.yul +++ b/test/libyul/yulOptimizerTests/structuralSimplifier/switch_inline_no_match_mixed.yul @@ -8,6 +8,4 @@ // ==== // step: structuralSimplifier // ---- -// { -// let y := 200 -// } +// { let y := 200 } diff --git a/test/libyul/yulOptimizerTests/structuralSimplifier/switch_no_remove_empty_case.yul b/test/libyul/yulOptimizerTests/structuralSimplifier/switch_no_remove_empty_case.yul index a09a5510b..8629be3f6 100644 --- a/test/libyul/yulOptimizerTests/structuralSimplifier/switch_no_remove_empty_case.yul +++ b/test/libyul/yulOptimizerTests/structuralSimplifier/switch_no_remove_empty_case.yul @@ -11,12 +11,7 @@ // { // let y := 200 // switch calldataload(0) -// case 0 { -// } -// case 1 { -// y := 9 -// } -// default { -// y := 100 -// } +// case 0 { } +// case 1 { y := 9 } +// default { y := 100 } // } diff --git a/test/libyul/yulOptimizerTests/structuralSimplifier/switch_only_default.yul b/test/libyul/yulOptimizerTests/structuralSimplifier/switch_only_default.yul index a9f3aea69..05689edd4 100644 --- a/test/libyul/yulOptimizerTests/structuralSimplifier/switch_only_default.yul +++ b/test/libyul/yulOptimizerTests/structuralSimplifier/switch_only_default.yul @@ -6,7 +6,5 @@ // ---- // { // pop(mload(0)) -// { -// mstore(1, 2) -// } +// { mstore(1, 2) } // } diff --git a/test/libyul/yulOptimizerTests/structuralSimplifier/switch_remove_empty_case.yul b/test/libyul/yulOptimizerTests/structuralSimplifier/switch_remove_empty_case.yul index 9cbae83ba..d96f74835 100644 --- a/test/libyul/yulOptimizerTests/structuralSimplifier/switch_remove_empty_case.yul +++ b/test/libyul/yulOptimizerTests/structuralSimplifier/switch_remove_empty_case.yul @@ -11,10 +11,6 @@ // { // let y := 200 // switch calldataload(0) -// case 1 { -// y := 9 -// } -// case 2 { -// y := 10 -// } +// case 1 { y := 9 } +// case 2 { y := 10 } // } diff --git a/test/libyul/yulOptimizerTests/structuralSimplifier/switch_remove_empty_cases.yul b/test/libyul/yulOptimizerTests/structuralSimplifier/switch_remove_empty_cases.yul index 5ffdcb1ee..45a89abd3 100644 --- a/test/libyul/yulOptimizerTests/structuralSimplifier/switch_remove_empty_cases.yul +++ b/test/libyul/yulOptimizerTests/structuralSimplifier/switch_remove_empty_cases.yul @@ -10,8 +10,5 @@ // ---- // { // let y := 200 -// if eq(1, calldataload(0)) -// { -// y := 9 -// } +// if eq(1, calldataload(0)) { y := 9 } // } diff --git a/test/libyul/yulOptimizerTests/structuralSimplifier/switch_remove_empty_default_case.yul b/test/libyul/yulOptimizerTests/structuralSimplifier/switch_remove_empty_default_case.yul index 1c9f64a21..33a46b0bc 100644 --- a/test/libyul/yulOptimizerTests/structuralSimplifier/switch_remove_empty_default_case.yul +++ b/test/libyul/yulOptimizerTests/structuralSimplifier/switch_remove_empty_default_case.yul @@ -11,10 +11,6 @@ // { // let y := 200 // switch calldataload(0) -// case 1 { -// y := 9 -// } -// case 2 { -// y := 10 -// } +// case 1 { y := 9 } +// case 2 { y := 10 } // } diff --git a/test/libyul/yulOptimizerTests/structuralSimplifier/switch_to_if.yul b/test/libyul/yulOptimizerTests/structuralSimplifier/switch_to_if.yul index 97a4ab181..0b3acee82 100644 --- a/test/libyul/yulOptimizerTests/structuralSimplifier/switch_to_if.yul +++ b/test/libyul/yulOptimizerTests/structuralSimplifier/switch_to_if.yul @@ -5,8 +5,5 @@ // step: structuralSimplifier // ---- // { -// if eq(2, calldataload(0)) -// { -// mstore(0, 0) -// } +// if eq(2, calldataload(0)) { mstore(0, 0) } // } diff --git a/test/libyul/yulOptimizerTests/unusedPruner/functions.yul b/test/libyul/yulOptimizerTests/unusedPruner/functions.yul index 44a15b152..80758f082 100644 --- a/test/libyul/yulOptimizerTests/unusedPruner/functions.yul +++ b/test/libyul/yulOptimizerTests/unusedPruner/functions.yul @@ -5,5 +5,4 @@ // ==== // step: unusedPruner // ---- -// { -// } +// { } diff --git a/test/libyul/yulOptimizerTests/unusedPruner/intermediate_multi_assignment.yul b/test/libyul/yulOptimizerTests/unusedPruner/intermediate_multi_assignment.yul index 744c58df6..2dd207fbf 100644 --- a/test/libyul/yulOptimizerTests/unusedPruner/intermediate_multi_assignment.yul +++ b/test/libyul/yulOptimizerTests/unusedPruner/intermediate_multi_assignment.yul @@ -10,8 +10,7 @@ // { // let a, b // function f() -> x -// { -// } +// { } // a := f() // b := 1 // } diff --git a/test/libyul/yulOptimizerTests/unusedPruner/multi_assign.yul b/test/libyul/yulOptimizerTests/unusedPruner/multi_assign.yul index 35120111b..77e9306c9 100644 --- a/test/libyul/yulOptimizerTests/unusedPruner/multi_assign.yul +++ b/test/libyul/yulOptimizerTests/unusedPruner/multi_assign.yul @@ -11,7 +11,6 @@ // let a // let b // function f() -> x, y -// { -// } +// { } // a, b := f() // } diff --git a/test/libyul/yulOptimizerTests/unusedPruner/multi_declarations.yul b/test/libyul/yulOptimizerTests/unusedPruner/multi_declarations.yul index c7a8285de..76bd6a510 100644 --- a/test/libyul/yulOptimizerTests/unusedPruner/multi_declarations.yul +++ b/test/libyul/yulOptimizerTests/unusedPruner/multi_declarations.yul @@ -4,5 +4,4 @@ // ==== // step: unusedPruner // ---- -// { -// } +// { } diff --git a/test/libyul/yulOptimizerTests/unusedPruner/multi_declare.yul b/test/libyul/yulOptimizerTests/unusedPruner/multi_declare.yul index afa27ea8a..58c969e6d 100644 --- a/test/libyul/yulOptimizerTests/unusedPruner/multi_declare.yul +++ b/test/libyul/yulOptimizerTests/unusedPruner/multi_declare.yul @@ -7,7 +7,6 @@ // ---- // { // function f() -> x, y -// { -// } +// { } // let a, b := f() // } diff --git a/test/libyul/yulOptimizerTests/unusedPruner/pop.yul b/test/libyul/yulOptimizerTests/unusedPruner/pop.yul index 76cb497b6..089098215 100644 --- a/test/libyul/yulOptimizerTests/unusedPruner/pop.yul +++ b/test/libyul/yulOptimizerTests/unusedPruner/pop.yul @@ -5,5 +5,4 @@ // ==== // step: unusedPruner // ---- -// { -// } +// { } diff --git a/test/libyul/yulOptimizerTests/unusedPruner/smoke.yul b/test/libyul/yulOptimizerTests/unusedPruner/smoke.yul index c29765b3d..9adf68be5 100644 --- a/test/libyul/yulOptimizerTests/unusedPruner/smoke.yul +++ b/test/libyul/yulOptimizerTests/unusedPruner/smoke.yul @@ -2,5 +2,4 @@ // ==== // step: unusedPruner // ---- -// { -// } +// { } diff --git a/test/libyul/yulOptimizerTests/unusedPruner/trivial.yul b/test/libyul/yulOptimizerTests/unusedPruner/trivial.yul index 1297b2633..b3a05d38f 100644 --- a/test/libyul/yulOptimizerTests/unusedPruner/trivial.yul +++ b/test/libyul/yulOptimizerTests/unusedPruner/trivial.yul @@ -6,6 +6,4 @@ // ==== // step: unusedPruner // ---- -// { -// mstore(0, 1) -// } +// { mstore(0, 1) } diff --git a/test/libyul/yulOptimizerTests/varDeclInitializer/simple.yul b/test/libyul/yulOptimizerTests/varDeclInitializer/simple.yul index 819081fc1..62d21dd0f 100644 --- a/test/libyul/yulOptimizerTests/varDeclInitializer/simple.yul +++ b/test/libyul/yulOptimizerTests/varDeclInitializer/simple.yul @@ -4,6 +4,4 @@ // ==== // step: varDeclInitializer // ---- -// { -// let a := 0 -// } +// { let a := 0 } diff --git a/test/libyul/yulOptimizerTests/varNameCleaner/builtins.yul b/test/libyul/yulOptimizerTests/varNameCleaner/builtins.yul index af7d62ccc..694d21847 100644 --- a/test/libyul/yulOptimizerTests/varNameCleaner/builtins.yul +++ b/test/libyul/yulOptimizerTests/varNameCleaner/builtins.yul @@ -4,6 +4,4 @@ // ==== // step: varNameCleaner // ---- -// { -// let datasize_1 := 1 -// } +// { let datasize_1 := 1 } diff --git a/test/libyul/yulOptimizerTests/varNameCleaner/function_names.yul b/test/libyul/yulOptimizerTests/varNameCleaner/function_names.yul index f4f2b76c8..629b5451e 100644 --- a/test/libyul/yulOptimizerTests/varNameCleaner/function_names.yul +++ b/test/libyul/yulOptimizerTests/varNameCleaner/function_names.yul @@ -9,8 +9,6 @@ // { // let f_1 // function f() -// { -// let f_1 -// } +// { let f_1 } // let f_2 // } diff --git a/test/libyul/yulOptimizerTests/varNameCleaner/function_scopes.yul b/test/libyul/yulOptimizerTests/varNameCleaner/function_scopes.yul index 866e7a3df..7dabb4d47 100644 --- a/test/libyul/yulOptimizerTests/varNameCleaner/function_scopes.yul +++ b/test/libyul/yulOptimizerTests/varNameCleaner/function_scopes.yul @@ -7,11 +7,7 @@ // ---- // { // function f() -// { -// let x := 0 -// } +// { let x := 0 } // function g() -// { -// let x := 0 -// } +// { let x := 0 } // } diff --git a/test/libyul/yulOptimizerTests/varNameCleaner/instructions.yul b/test/libyul/yulOptimizerTests/varNameCleaner/instructions.yul index 7c5aca950..acf71b1d9 100644 --- a/test/libyul/yulOptimizerTests/varNameCleaner/instructions.yul +++ b/test/libyul/yulOptimizerTests/varNameCleaner/instructions.yul @@ -4,6 +4,4 @@ // ==== // step: varNameCleaner // ---- -// { -// let mul_1 := 1 -// } +// { let mul_1 := 1 }