| 163 | } |
| 164 | |
| 165 | std::set<Function *> RDSpace::buildCallerMap(Function &F) { |
| 166 | std::set<Function *> Result; |
| 167 | for (BasicBlock &B : F) |
| 168 | for (Instruction &I : B) { |
| 169 | auto *CB = dyn_cast_or_null<CallBase>(&I); |
| 170 | if (!CB) |
| 171 | continue; |
| 172 | |
| 173 | auto *CF = const_cast<Function *>(util::getCalledFunction(*CB)); |
| 174 | if (!CF) |
| 175 | continue; |
| 176 | |
| 177 | updateMap(CallerMap, CF, CB); |
| 178 | if (CF->size() == 0) |
| 179 | continue; |
| 180 | |
| 181 | Result.insert(CF); |
| 182 | } |
| 183 | return Result; |
| 184 | } |
| 185 | |
| 186 | void RDSpace::build(Function &F) { |
| 187 | // 1. Traversing Instructions to get space information |
nothing calls this directly
no test coverage detected