MCPcopy Create free account
hub / github.com/argotorg/solidity / operator()

Method operator()

libyul/optimiser/ConditionalSimplifier.cpp:37–60  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

35}
36
37void ConditionalSimplifier::operator()(Switch& _switch)
38{
39 visit(*_switch.expression);
40 if (!std::holds_alternative<Identifier>(*_switch.expression))
41 {
42 ASTModifier::operator()(_switch);
43 return;
44 }
45 YulName expr = std::get<Identifier>(*_switch.expression).name;
46 for (auto& _case: _switch.cases)
47 {
48 if (_case.value)
49 {
50 (*this)(*_case.value);
51 auto assignment = Statement{Assignment{
52 _case.body.debugData,
53 {Identifier{_case.body.debugData, expr}},
54 std::make_unique<Expression>(*_case.value)
55 }};
56 _case.body.statements.insert(_case.body.statements.begin(), std::move(assignment));
57 }
58 (*this)(_case.body);
59 }
60}
61
62void ConditionalSimplifier::operator()(Block& _block)
63{

Callers

nothing calls this directly

Calls 7

iterateReplacingFunction · 0.85
TerminationFinderClass · 0.85
insertMethod · 0.80
controlFlowKindMethod · 0.80
zeroLiteralMethod · 0.80
beginMethod · 0.45
emptyMethod · 0.45

Tested by

no test coverage detected