MCPcopy Create free account
hub / github.com/Samsung/UTopia / find

Method find

lib/utanalysis/TargetAPIFinder.cpp:27–56  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

25
26template <typename T1, typename T2>
27void TargetAPIFinder::find(std::vector<Function *> &Funcs, T1 &SrcMap,
28 T2 &Result) {
29 std::queue<Function *> Queue;
30 for (auto *Func : Funcs) {
31 if (!Func)
32 throw std::invalid_argument("Pointer is Null");
33 Queue.push(Func);
34 }
35
36 std::set<Function *> Visited;
37 while (Queue.size() > 0) {
38 Function *Next = Queue.front();
39 assert(Next && "Unexpected Program State");
40 Queue.pop();
41
42 if (Visited.find(Next) != Visited.end())
43 continue;
44 Visited.insert(Next);
45
46 update(*Next);
47 auto AccSrc = SrcMap.find(Next);
48 assert(AccSrc != SrcMap.end() && "Unexpected Program State");
49 Result.insert(AccSrc->second.begin(), AccSrc->second.end());
50
51 auto AccSubroutines = Subroutines.find(Next);
52 assert(AccSubroutines != Subroutines.end() && "Unexpected Program State");
53 for (auto *Subroutine : AccSubroutines->second)
54 Queue.push(Subroutine);
55 }
56}
57
58void TargetAPIFinder::update(Function &Func) {
59 std::set<llvm::Function *> CalleeSet;

Callers 15

findDefinedFunctionDeclsFunction · 0.45
getAllocSizeArgNoMethod · 0.45
replaceStringFunction · 0.45
getDemangledNameFunction · 0.45
findFilePathsFunction · 0.45
insertMacroNodeMethod · 0.45
getASTNodeMethod · 0.45
getASTDefNodeMethod · 0.45
getFromCallMapMethod · 0.45
getFromArgMapMethod · 0.45
getFromDefMapMethod · 0.45

Calls 5

pushMethod · 0.80
sizeMethod · 0.80
popMethod · 0.80
endMethod · 0.80
beginMethod · 0.80

Tested by 1

getMethod · 0.36