Introduce LiteralRematerializer and thus simplify StructuralSimplifier.

This commit is contained in:
chriseth
2019-09-11 19:50:24 +02:00
parent a064e0fc97
commit fcfe829534
10 changed files with 152 additions and 145 deletions
+5 -5
View File
@@ -30,16 +30,16 @@ namespace yul
* - replace switch with const expr with matching case body
* - replace for with false condition by its initialization part
*
* Prerequisite: Disambiguator, ForLoopInitRewriter.
* The LiteralRematerialiser should be run before this.
*
* Prerequisite: Disambiguator.
*
* Important: Can only be used on EVM code.
*/
class StructuralSimplifier: public DataFlowAnalyzer
class StructuralSimplifier: public ASTModifier
{
public:
explicit StructuralSimplifier(Dialect const& _dialect): DataFlowAnalyzer(_dialect) {}
using DataFlowAnalyzer::operator();
using ASTModifier::operator();
void operator()(Block& _block) override;
private:
void simplify(std::vector<Statement>& _statements);