mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Rewrite GenericVisitor
This commit is contained in:
@@ -71,7 +71,8 @@ void StructuralSimplifier::operator()(Block& _block)
|
||||
|
||||
void StructuralSimplifier::simplify(std::vector<yul::Statement>& _statements)
|
||||
{
|
||||
GenericFallbackReturnsVisitor<OptionalStatements, If, Switch, ForLoop> const visitor(
|
||||
GenericVisitor visitor{
|
||||
VisitorFallback<OptionalStatements>{},
|
||||
[&](If& _ifStmt) -> OptionalStatements {
|
||||
if (expressionAlwaysTrue(*_ifStmt.condition))
|
||||
return {std::move(_ifStmt.body.statements)};
|
||||
@@ -89,7 +90,7 @@ void StructuralSimplifier::simplify(std::vector<yul::Statement>& _statements)
|
||||
return {std::move(_forLoop.pre.statements)};
|
||||
return {};
|
||||
}
|
||||
);
|
||||
};
|
||||
|
||||
iterateReplacing(
|
||||
_statements,
|
||||
|
||||
Reference in New Issue
Block a user