Skip to content

Commit f2d9a80

Browse files
committed
Document change to BlockFlattener.
1 parent 9fb77b1 commit f2d9a80

File tree

1 file changed

+13
-7
lines changed

1 file changed

+13
-7
lines changed

docs/internals/optimizer.rst

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -972,15 +972,19 @@ BlockFlattener
972972
^^^^^^^^^^^^^^
973973

974974
This stage eliminates nested blocks by inserting the statement in the
975-
inner block at the appropriate place in the outer block:
975+
inner block at the appropriate place in the outer block. It depends on the
976+
FunctionGrouper and does not flatten the outermost block to keep the form
977+
produced by the FunctionGrouper.
976978

977979
.. code-block:: yul
978980
979981
{
980-
let x := 2
981982
{
982-
let y := 3
983-
mstore(x, y)
983+
let x := 2
984+
{
985+
let y := 3
986+
mstore(x, y)
987+
}
984988
}
985989
}
986990
@@ -989,9 +993,11 @@ is transformed to
989993
.. code-block:: yul
990994
991995
{
992-
let x := 2
993-
let y := 3
994-
mstore(x, y)
996+
{
997+
let x := 2
998+
let y := 3
999+
mstore(x, y)
1000+
}
9951001
}
9961002
9971003
As long as the code is disambiguated, this does not cause a problem because

0 commit comments

Comments
 (0)