mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Remove flag.
This commit is contained in:
@@ -22,12 +22,9 @@
|
||||
#include <libyul/optimiser/ExpressionSimplifier.h>
|
||||
|
||||
#include <libyul/optimiser/SimplificationRules.h>
|
||||
#include <libyul/optimiser/Semantics.h>
|
||||
#include <libyul/optimiser/OptimiserStep.h>
|
||||
#include <libyul/AsmData.h>
|
||||
|
||||
#include <libsolutil/CommonData.h>
|
||||
|
||||
using namespace std;
|
||||
using namespace solidity;
|
||||
using namespace solidity::yul;
|
||||
@@ -40,17 +37,7 @@ void ExpressionSimplifier::run(OptimiserStepContext& _context, Block& _ast)
|
||||
void ExpressionSimplifier::visit(Expression& _expression)
|
||||
{
|
||||
ASTModifier::visit(_expression);
|
||||
while (auto match = SimplificationRules::findFirstMatch(_expression, m_dialect, m_value))
|
||||
{
|
||||
// Do not apply the rule if it removes non-constant parts of the expression.
|
||||
// TODO: The check could actually be less strict than "movable".
|
||||
// We only require "Does not cause side-effects".
|
||||
// Note: References to variables that are only assigned once are always movable,
|
||||
// so if the value of the variable is not movable, the expression that references
|
||||
// the variable still is.
|
||||
|
||||
if (match->removesNonConstants && !SideEffectsCollector(m_dialect, _expression).movable())
|
||||
return;
|
||||
while (auto const* match = SimplificationRules::findFirstMatch(_expression, m_dialect, m_value))
|
||||
_expression = match->action().toExpression(locationOf(_expression));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user