Require for loop init rewriter for SSA.

Co-authored-by: Harikrishnan Mulackal <webmail.hari@gmail.com>
This commit is contained in:
chriseth
2020-07-03 19:24:31 +02:00
committed by Daniel Kirchner
co-authored by Harikrishnan Mulackal
parent c0ee566049
commit 711ed588d7
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
{