I have an object of type CallInst
. How can I get the name of the called function (aka callee). Assume the function is called directly (i.e., no indirect function calls).
StringRef get_function_name(CallInst *call)
{
Function *fun = call->getCalledFunction();
if (fun) // thanks @Anton Korobeynikov
return fun->getName(); // inherited from llvm::Value
else
return StringRef("indirect call");
}
anyway, that's what the documentation implies:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With