MCPcopy Create free account
hub / github.com/AdaptiveCpp/AdaptiveCpp / collectAllCallersFromSet

Function collectAllCallersFromSet

src/compiler/stdpar/MallocToUSM.cpp:120–141  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

118
119template <class CallerMapT, class SetT>
120void collectAllCallersFromSet(const CallerMapT &CM, llvm::Function *F, const SetT &Input,
121 SetT &DiscardedOut, SetT &Out) {
122 if(!F)
123 return;
124
125 if(Out.contains(F) || DiscardedOut.contains(F) || !Input.contains(F)) {
126 DiscardedOut.insert(F);
127 return;
128 }
129
130 auto It = CM.find(F);
131 if(It == CM.end()) {
132 DiscardedOut.insert(F);
133 return;
134 }
135
136 Out.insert(F);
137
138 for(auto* Caller : It->getSecond()) {
139 collectAllCallersFromSet(CM, Caller, Input, DiscardedOut, Out);
140 }
141}
142}
143
144llvm::PreservedAnalyses MallocToUSMPass::run(llvm::Module &M, llvm::ModuleAnalysisManager &AM) {

Callers 1

runMethod · 0.85

Calls 4

containsMethod · 0.45
insertMethod · 0.45
findMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected