diff options
Diffstat (limited to 'include/llvm/IR/CallSite.h')
-rw-r--r-- | include/llvm/IR/CallSite.h | 25 |
1 files changed, 22 insertions, 3 deletions
diff --git a/include/llvm/IR/CallSite.h b/include/llvm/IR/CallSite.h index 0270caaaf137..dd2903e807e1 100644 --- a/include/llvm/IR/CallSite.h +++ b/include/llvm/IR/CallSite.h @@ -38,6 +38,7 @@ class CallInst; class InvokeInst; template <typename FunTy = const Function, + typename BBTy = const BasicBlock, typename ValTy = const Value, typename UserTy = const User, typename InstrTy = const Instruction, @@ -82,6 +83,9 @@ public: InstrTy *operator->() const { return I.getPointer(); } explicit operator bool() const { return I.getPointer(); } + /// Get the basic block containing the call site + BBTy* getParent() const { return getInstruction()->getParent(); } + /// getCalledValue - Return the pointer to function that is being called. /// ValTy *getCalledValue() const { @@ -189,6 +193,20 @@ public: else \ cast<InvokeInst>(II)->METHOD + unsigned getNumArgOperands() const { + CALLSITE_DELEGATE_GETTER(getNumArgOperands()); + } + + ValTy *getArgOperand(unsigned i) const { + CALLSITE_DELEGATE_GETTER(getArgOperand(i)); + } + + bool isInlineAsm() const { + if (isCall()) + return cast<CallInst>(getInstruction())->isInlineAsm(); + return false; + } + /// getCallingConv/setCallingConv - get or set the calling convention of the /// call. CallingConv::ID getCallingConv() const { @@ -366,8 +384,9 @@ private: } }; -class CallSite : public CallSiteBase<Function, Value, User, Instruction, - CallInst, InvokeInst, User::op_iterator> { +class CallSite : public CallSiteBase<Function, BasicBlock, Value, User, + Instruction, CallInst, InvokeInst, + User::op_iterator> { public: CallSite() {} CallSite(CallSiteBase B) : CallSiteBase(B) {} @@ -397,6 +416,6 @@ public: ImmutableCallSite(CallSite CS) : CallSiteBase(CS.getInstruction()) {} }; -} // namespace llvm +} // End llvm namespace #endif |