MCPcopy Create free account
hub / github.com/cppcheck-opensource/cppcheck / removeFunctionCalls

Function removeFunctionCalls

lib/summaries.cpp:140–155  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

138}
139
140static void removeFunctionCalls(const std::string& calledFunction,
141 std::map<std::string, std::vector<std::string>> &functionCalledBy,
142 std::map<std::string, std::vector<std::string>> &functionCalls,
143 std::vector<std::string> &add)
144{
145 std::vector<std::string> calledBy = functionCalledBy[calledFunction];
146 functionCalledBy.erase(calledFunction);
147 for (const std::string &c: calledBy) {
148 std::vector<std::string> &calls = functionCalls[c];
149 calls.erase(std::remove(calls.begin(), calls.end(), calledFunction), calls.end());
150 if (calls.empty()) {
151 add.push_back(calledFunction);
152 removeFunctionCalls(c, functionCalledBy, functionCalls, add);
153 }
154 }
155}
156
157void Summaries::loadReturn(const std::string &buildDir, std::set<std::string> &summaryReturn)
158{

Callers 1

loadReturnMethod · 0.85

Calls 5

eraseMethod · 0.45
beginMethod · 0.45
endMethod · 0.45
emptyMethod · 0.45
push_backMethod · 0.45

Tested by

no test coverage detected