From f2d9a806e0a2a2fb8560cc24d391013dcdf32553 Mon Sep 17 00:00:00 2001 From: Daniel Kirchner Date: Tue, 9 Nov 2021 13:25:13 +0100 Subject: [PATCH] Document change to BlockFlattener. --- docs/internals/optimizer.rst | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/docs/internals/optimizer.rst b/docs/internals/optimizer.rst index 28c342902..d75eca419 100644 --- a/docs/internals/optimizer.rst +++ b/docs/internals/optimizer.rst @@ -972,15 +972,19 @@ BlockFlattener ^^^^^^^^^^^^^^ This stage eliminates nested blocks by inserting the statement in the -inner block at the appropriate place in the outer block: +inner block at the appropriate place in the outer block. It depends on the +FunctionGrouper and does not flatten the outermost block to keep the form +produced by the FunctionGrouper. .. code-block:: yul { - let x := 2 { - let y := 3 - mstore(x, y) + let x := 2 + { + let y := 3 + mstore(x, y) + } } } @@ -989,9 +993,11 @@ is transformed to .. code-block:: yul { - let x := 2 - let y := 3 - mstore(x, y) + { + let x := 2 + let y := 3 + mstore(x, y) + } } As long as the code is disambiguated, this does not cause a problem because