@returns a map from function name to rematerialisation costs to a vector of variables to rematerialise and variables that occur in their expression. While the map is sorted by cost, the contained vectors are sorted by the order of occurrence.
| 62 | /// and variables that occur in their expression. |
| 63 | /// While the map is sorted by cost, the contained vectors are sorted by the order of occurrence. |
| 64 | std::map<YulName, std::map<size_t, std::vector<YulName>>> candidates() |
| 65 | { |
| 66 | std::map<YulName, std::map<size_t, std::vector<YulName>>> cand; |
| 67 | for (auto const& [functionName, candidate]: m_candidates) |
| 68 | { |
| 69 | if (size_t const* cost = util::valueOrNullptr(m_expressionCodeCost, candidate)) |
| 70 | { |
| 71 | size_t numRef = m_numReferences[candidate]; |
| 72 | cand[functionName][*cost * numRef].emplace_back(candidate); |
| 73 | } |
| 74 | } |
| 75 | return cand; |
| 76 | } |
| 77 | |
| 78 | using DataFlowAnalyzer::operator(); |
| 79 | void operator()(FunctionDefinition& _function) override |
no test coverage detected