aboutsummaryrefslogtreecommitdiffstats
path: root/libyul/optimiser/RedundantAssignEliminator.h
diff options
context:
space:
mode:
Diffstat (limited to 'libyul/optimiser/RedundantAssignEliminator.h')
-rw-r--r--libyul/optimiser/RedundantAssignEliminator.h5
1 files changed, 4 insertions, 1 deletions
diff --git a/libyul/optimiser/RedundantAssignEliminator.h b/libyul/optimiser/RedundantAssignEliminator.h
index 4f82e7a2..2f4dd380 100644
--- a/libyul/optimiser/RedundantAssignEliminator.h
+++ b/libyul/optimiser/RedundantAssignEliminator.h
@@ -28,6 +28,7 @@
namespace yul
{
+struct Dialect;
/**
* Optimiser component that removes assignments to variables that are not used
@@ -98,6 +99,7 @@ namespace yul
class RedundantAssignEliminator: public ASTWalker
{
public:
+ explicit RedundantAssignEliminator(Dialect const& _dialect): m_dialect(&_dialect) {}
RedundantAssignEliminator(RedundantAssignEliminator const&) = default;
RedundantAssignEliminator& operator=(RedundantAssignEliminator const&) = default;
RedundantAssignEliminator(RedundantAssignEliminator&&) = default;
@@ -112,7 +114,7 @@ public:
void operator()(ForLoop const&) override;
void operator()(Block const& _block) override;
- static void run(Block& _ast);
+ static void run(Dialect const& _dialect, Block& _ast);
private:
RedundantAssignEliminator() = default;
@@ -167,6 +169,7 @@ private:
void changeUndecidedTo(YulString _variable, State _newState);
void finalize(YulString _variable);
+ Dialect const* m_dialect;
std::set<YulString> m_declaredVariables;
// TODO check that this does not cause nondeterminism!
// This could also be a pseudo-map from state to assignment.