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

Method candidates

libyul/optimiser/StackCompressor.cpp:64–76  ·  view source on GitHub ↗

@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.

Source from the content-addressed store, hash-verified

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

Callers 2

eliminateVariablesFunction · 0.80

Calls 1

valueOrNullptrFunction · 0.85

Tested by

no test coverage detected