MCPcopy Create free account
hub / github.com/argotorg/solidity / findFirstMatch

Method findFirstMatch

libevmasm/SimplificationRules.cpp:39–56  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

37using namespace solidity::langutil;
38
39SimplificationRule<Pattern> const* Rules::findFirstMatch(
40 Expression const& _expr,
41 ExpressionClasses const& _classes
42)
43{
44 resetMatchGroups();
45
46 assertThrow(_expr.item, OptimizerException, "");
47 for (auto const& rule: m_rules[uint8_t(_expr.item->instruction())])
48 {
49 if (rule.pattern.matches(_expr, _classes))
50 if (!rule.feasible || rule.feasible())
51 return &rule;
52
53 resetMatchGroups();
54 }
55 return nullptr;
56}
57
58bool Rules::isInitialized() const
59{

Callers 1

tryToSimplifyMethod · 0.45

Calls 2

instructionMethod · 0.45
matchesMethod · 0.45

Tested by

no test coverage detected