Checking CS.getCalledFunction() == nullptr does not necessary indicate indirect call. We also need to check if CS.getCalledValue() is not a constant.
Details
Details
Diff Detail
Diff Detail
- Build Status
- Buildable 3677 - Build 3677: arc lint + arc unit 
Event Timeline
| lib/Transforms/IPO/SampleProfile.cpp | ||
|---|---|---|
| 639 | Refactor the code in llvm/Analysis/IndirectCallSiteVisitor.h and reuse the indirect call site query routine. | |
| include/llvm/IR/CallSite.h | ||
|---|---|---|
| 121 ↗ | (On Diff #87275) | I used "stripPointerCasts" on getCalledValue() so that this is not needed any more. | 
| include/llvm/IR/CallSite.h | ||
|---|---|---|
| 121 ↗ | (On Diff #87275) | how is it so? | 
| include/llvm/IR/CallSite.h | ||
|---|---|---|
| 121 ↗ | (On Diff #87275) | stripPointerCasts comment says "Strip off pointer casts, all-zero GEPs, and aliases.", so for the constants (alias), it will give the actual function that it aliases to. | 
Refactor the code in llvm/Analysis/IndirectCallSiteVisitor.h and reuse the indirect call site query routine.