Split structural simplifier.

This commit is contained in:
chriseth
2019-05-13 10:26:57 +02:00
parent a28b6224a4
commit d9831c8b96
7 changed files with 224 additions and 99 deletions
-7
View File
@@ -25,14 +25,8 @@ namespace yul
/**
* Structural simplifier. Performs the following simplification steps:
* - replace if with empty body with pop(condition)
* - replace if with true condition with its body
* - remove if with false condition
* - remove empty default switch case
* - remove empty switch case if no default case exists
* - replace switch with no cases with pop(expression)
* - turn switch with single case into if
* - replace switch with only default case with pop(expression) and body
* - replace switch with const expr with matching case body
* - replace for with false condition by its initialization part
*
@@ -52,7 +46,6 @@ private:
bool expressionAlwaysTrue(Expression const& _expression);
bool expressionAlwaysFalse(Expression const& _expression);
boost::optional<dev::u256> hasLiteralValue(Expression const& _expression) const;
boost::optional<std::vector<Statement>> reduceNoCaseSwitch(Switch& _switchStmt) const;
};
}