I have an object of type CallInst . How can I get the name of the called function from it. Suppose a function is called directly.
CallInst
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"); }
In any case, what the documentation implies: