[llvm-dev] CallInst::getCalledFunction returns null?

Christian Convey via llvm-dev llvm-dev at lists.llvm.org
Tue Sep 8 08:16:52 PDT 2015


I was wondering if someone could explain why CallInst::getCalledFunc behaves
the way it does.

For simple, direct call instructions in my IR, that method behaves just as
one would expect.

However, for instructions like this:

%25 = call i32 (%struct._IO_FILE*, ...)* bitcast (i32 (...)* @close to i32
> (%struct._IO_FILE*, ...)*)(%struct._IO_FILE* %24), !dbg !695


getCalledFunc returns null.

I know getCalledFunc is expected to return null
<http://llvm.org/docs/doxygen/html/classllvm_1_1CallInst.html#a0bcd4131e1a1d92215f5385b4e16cd2e>
on
indirect calls, but I would have thought naming the callee via a constant
expression like the one here would be considered a direct call.

Thanks,
Christian
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20150908/a432fd98/attachment.html>


More information about the llvm-dev mailing list