diff options
Diffstat (limited to 'include/llvm/IR/CallSite.h')
-rw-r--r-- | include/llvm/IR/CallSite.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/include/llvm/IR/CallSite.h b/include/llvm/IR/CallSite.h index b47a96c5d5fa..13b1ae8d0e32 100644 --- a/include/llvm/IR/CallSite.h +++ b/include/llvm/IR/CallSite.h @@ -854,6 +854,15 @@ public: return CI.ParameterEncoding[0]; } + /// Return the use of the callee value in the underlying instruction. Only + /// valid for callback calls! + const Use &getCalleeUseForCallback() const { + int CalleeArgIdx = getCallArgOperandNoForCallee(); + assert(CalleeArgIdx >= 0 && + unsigned(CalleeArgIdx) < getInstruction()->getNumOperands()); + return getInstruction()->getOperandUse(CalleeArgIdx); + } + /// Return the pointer to function that is being called. Value *getCalledValue() const { if (isDirectCall()) |