[llvm-dev] CallSiteBase::getCalledFunction and non-trivial calls

via llvm-dev llvm-dev at lists.llvm.org
Wed Sep 12 11:51:43 PDT 2018


How does LLVM define "indirect call"? The documentation of 
CallSiteBase::getCalledFunction claims it returns null for indirect 
calls, but in practice it seems to return null for "non-trivial" calls. 
For example, it returns null for a direct call to a bitcast'ed function:

%0 = call void bitcast (void (%struct.foo *)* @func to void (%struct.bar 
*)*)(%struct.bar *qux)

By some definition "direct" could mean "trivial", but here it seems 
ambiguous at best.

I was able to find some discussion of this previously at 
http://lists.llvm.org/pipermail/llvm-dev/2015-November/092396.html but 
it feels like the docs/implementation of some of the functions in 
CallSiteBase (isIndirectCall also does not seem quite correct, and is 
not used in a couple places it could be) should just be updated to 
reflect this.

Is my assessment reasonable? I can update these functions, but it will 
require updating uses throughout the codebase so I wanted to ask if this 
makes any sense before starting the work.

Regards,
Scott


More information about the llvm-dev mailing list