diff options
Diffstat (limited to 'llvm/lib/Transforms')
| -rw-r--r-- | llvm/lib/Transforms/Instrumentation/PGOInstrumentation.cpp | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/llvm/lib/Transforms/Instrumentation/PGOInstrumentation.cpp b/llvm/lib/Transforms/Instrumentation/PGOInstrumentation.cpp index f32e94d19fe..23947137c67 100644 --- a/llvm/lib/Transforms/Instrumentation/PGOInstrumentation.cpp +++ b/llvm/lib/Transforms/Instrumentation/PGOInstrumentation.cpp @@ -329,14 +329,16 @@ BasicBlock *FuncPGOInstrumentation<Edge, BBInfo>::getInstrBB(Edge *E) { // Visitor class that finds all indirect call sites. struct PGOIndirectCallSiteVisitor : public InstVisitor<PGOIndirectCallSiteVisitor> { - std::vector<CallInst *> IndirectCallInsts; + std::vector<Instruction *> IndirectCallInsts; PGOIndirectCallSiteVisitor() {} - void visitCallInst(CallInst &I) { - CallSite CS(&I); - if (CS.getCalledFunction() || !CS.getCalledValue() || I.isInlineAsm()) + void visitCallSite(CallSite CS) { + Instruction *I = CS.getInstruction(); + CallInst *CI = dyn_cast<CallInst>(I); + if (CS.getCalledFunction() || !CS.getCalledValue() || + (CI && CI->isInlineAsm())) return; - IndirectCallInsts.push_back(&I); + IndirectCallInsts.push_back(I); } }; |

