[PATCH] D52894: Update CallSite docs and add a new function (NFC)

Eli Friedman via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Oct 18 11:27:30 PDT 2018


efriedma added inline comments.


================
Comment at: include/llvm/IR/CallSite.h:126
+  /// same function. For example, a call to a bitcast of a function is
+  /// considered indirect.
   bool isIndirectCall() const {
----------------
scott.linder wrote:
> efriedma wrote:
> > This isn't what isIndirectCall actually implements...
> Right, I completely missed that a BitCast is a Constant, and also did not mention the specific check for InlineAsm.
> 
> When can `getCalledValue` return `nullptr`? And is this definition "correct" for LLVM (e.g. an indirect call is any call which is not one of these cases)?
getCalledValue never returns nullptr.

Assuming you meant getCalledFunction, it only returns non-null if the callee is a Function.

isIndirectCall() isn't really used by anything outside of profiling infrastructure, so the implementation doesn't really affect much.

Maybe it's best to try to avoid defining "direct" and "indirect" calls, and just directly describe what the functions return.


https://reviews.llvm.org/D52894





More information about the llvm-commits mailing list