mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Require for loop init rewriter for SSA.
Co-authored-by: Harikrishnan Mulackal <webmail.hari@gmail.com>
This commit is contained in:
committed by
Daniel Kirchner
co-authored by
Harikrishnan Mulackal
parent
c0ee566049
commit
711ed588d7
@@ -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);
|
||||
|
||||
@@ -85,7 +85,7 @@ class NameDispenser;
|
||||
*
|
||||
* TODO Which transforms are required to keep this idempotent?
|
||||
*
|
||||
* Prerequisite: Disambiguator.
|
||||
* Prerequisite: Disambiguator, ForLoopInitRewriter.
|
||||
*/
|
||||
class SSATransform: public ASTModifier
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user