Implement property CallOrInvokeInstruction.called_function

Also add a testcase.
This commit is contained in:
Wladimir J. van der Laan 2012-09-02 13:22:00 +02:00
commit 5bd4991f0b
5 changed files with 20 additions and 1 deletions

View file

@ -750,6 +750,12 @@ unsigned LLVMCmpInstGetPredicate(LLVMValueRef cmpinst)
return instp->getPredicate();
}
LLVMValueRef LLVMInstGetCalledFunction(LLVMValueRef inst)
{
llvm::Instruction *instp = llvm::unwrap<llvm::Instruction>(inst);
return llvm::wrap(CallSite(instp).getCalledFunction());
}
/* llvm::unwrap a set of `n' wrapped objects starting at `values',
* into a vector of pointers to llvm::unwrapped objects `out'. */
template <typename W, typename UW>