I want to know if an llvm::intruction is a function call and if so what is the name of the fucntion it is calling to.
Also is there a way to get llvm::CallInst from an llvm::Instruction?
Instruction* I = ...
if (isa<CallInst>(I)) {
StringRef name = cast<CallInst>(I).getCalledFunction().getName();
...
}
For more information on this, see the relevant section in LLVM Programmer's Manual. In general, I wholeheartedly recommend this guide for beginners.
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