diff options
author | chriseth <chris@ethereum.org> | 2019-01-08 00:23:05 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-01-08 00:23:05 +0800 |
commit | 9f5d34af7de481c5b8ce89057a6df2a3283d14b0 (patch) | |
tree | 273c2c234e637a8c33ebbe041d8f2c4f8ef99c51 /libyul/optimiser/ExpressionSimplifier.cpp | |
parent | 165a6891212bd440a65da4084a823dccbf83a433 (diff) | |
parent | 9222eff08fad8e6a0ea7df8b299880f90c68c8b3 (diff) | |
download | dexon-solidity-9f5d34af7de481c5b8ce89057a6df2a3283d14b0.tar.gz dexon-solidity-9f5d34af7de481c5b8ce89057a6df2a3283d14b0.tar.zst dexon-solidity-9f5d34af7de481c5b8ce89057a6df2a3283d14b0.zip |
Merge pull request #5752 from ethereum/addDialect
[Yul] Refactor: Make the dialect available everywhere.
Diffstat (limited to 'libyul/optimiser/ExpressionSimplifier.cpp')
-rw-r--r-- | libyul/optimiser/ExpressionSimplifier.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/libyul/optimiser/ExpressionSimplifier.cpp b/libyul/optimiser/ExpressionSimplifier.cpp index cda44e8e..b26e4245 100644 --- a/libyul/optimiser/ExpressionSimplifier.cpp +++ b/libyul/optimiser/ExpressionSimplifier.cpp @@ -36,7 +36,7 @@ using namespace dev::solidity; void ExpressionSimplifier::visit(Expression& _expression) { ASTModifier::visit(_expression); - while (auto match = SimplificationRules::findFirstMatch(_expression, m_ssaValues)) + while (auto match = SimplificationRules::findFirstMatch(_expression, m_dialect, m_ssaValues)) { // Do not apply the rule if it removes non-constant parts of the expression. // TODO: The check could actually be less strict than "movable". @@ -45,15 +45,15 @@ void ExpressionSimplifier::visit(Expression& _expression) // so if the value of the variable is not movable, the expression that references // the variable still is. - if (match->removesNonConstants && !MovableChecker(_expression).movable()) + if (match->removesNonConstants && !MovableChecker(m_dialect, _expression).movable()) return; _expression = match->action().toExpression(locationOf(_expression)); } } -void ExpressionSimplifier::run(Block& _ast) +void ExpressionSimplifier::run(Dialect const& _dialect, Block& _ast) { SSAValueTracker ssaValues; ssaValues(_ast); - ExpressionSimplifier{ssaValues.values()}(_ast); + ExpressionSimplifier{_dialect, ssaValues.values()}(_ast); } |