Merge pull request #9295 from ethereum/requireFLIR

Require for loop init rewriter for SSA.
This commit is contained in:
Daniel Kirchner
2020-07-04 17:51:57 +02:00
committed by GitHub
8 changed files with 49 additions and 28 deletions
+2 -6
View File
@@ -194,7 +194,7 @@ void IntroduceControlFlowSSA::operator()(FunctionDefinition& _function)
void IntroduceControlFlowSSA::operator()(ForLoop& _for)
{
(*this)(_for.pre);
yulAssert(_for.pre.statements.empty(), "For loop init rewriter not run.");
Assignments assignments;
assignments(_for.body);
@@ -357,11 +357,7 @@ void PropagateValues::operator()(Assignment& _assignment)
void PropagateValues::operator()(ForLoop& _for)
{
// This will clear the current value in case of a reassignment inside the
// init part, although the new variable would still be in scope inside the whole loop.
// This small inefficiency is fine if we move the pre part of all for loops out
// of the for loop.
(*this)(_for.pre);
yulAssert(_for.pre.statements.empty(), "For loop init rewriter not run.");
Assignments assignments;
assignments(_for.body);
+1 -1
View File
@@ -85,7 +85,7 @@ class NameDispenser;
*
* TODO Which transforms are required to keep this idempotent?
*
* Prerequisite: Disambiguator.
* Prerequisite: Disambiguator, ForLoopInitRewriter.
*/
class SSATransform: public ASTModifier
{