X-Git-Url: http://demsky.eecs.uci.edu/git/?a=blobdiff_plain;f=include%2Fllvm%2FSupport%2FCallSite.h;h=285b558afccbae1f4acd669e1250cf2dfd803b63;hb=71a5c22c2b635ea903c3ae7d2695ca649b38726f;hp=544c7d7761b1489f9034c111b55d310464458d0f;hpb=255b26ea3529ca096313c85dcf006565c7e916f9;p=oota-llvm.git diff --git a/include/llvm/Support/CallSite.h b/include/llvm/Support/CallSite.h index 544c7d7761b..285b558afcc 100644 --- a/include/llvm/Support/CallSite.h +++ b/include/llvm/Support/CallSite.h @@ -26,6 +26,7 @@ #include "llvm/Attributes.h" #include "llvm/ADT/PointerIntPair.h" #include "llvm/BasicBlock.h" +#include "llvm/CallingConv.h" #include "llvm/Instruction.h" namespace llvm { @@ -40,14 +41,10 @@ public: CallSite(CallInst *CI) : I(reinterpret_cast(CI), true) {} CallSite(InvokeInst *II) : I(reinterpret_cast(II), false) {} CallSite(Instruction *C); - CallSite(const CallSite &CS) : I(CS.I) {} - CallSite &operator=(const CallSite &CS) { I = CS.I; return *this; } - - bool operator==(const CallSite &CS) const { return getInstruction() - == CS.getInstruction(); } - bool operator!=(const CallSite &CS) const { return getInstruction() - != CS.getInstruction(); } - + + bool operator==(const CallSite &CS) const { return I == CS.I; } + bool operator!=(const CallSite &CS) const { return I != CS.I; } + /// CallSite::get - This static method is sort of like a constructor. It will /// create an appropriate call site for a Call or Invoke instruction, but it /// can also create a null initialized CallSite object for something which is @@ -65,8 +62,8 @@ public: /// getCallingConv/setCallingConv - get or set the calling convention of the /// call. - unsigned getCallingConv() const; - void setCallingConv(unsigned CC); + CallingConv::ID getCallingConv() const; + void setCallingConv(CallingConv::ID CC); /// getAttributes/setAttributes - get or set the parameter attributes of /// the call. @@ -170,7 +167,7 @@ public: /// list for a call site. arg_iterator arg_begin() const { assert(getInstruction() && "Not a call or invoke instruction!"); - // Skip non-arguments + // Skip non-arguments return getInstruction()->op_begin() + getArgumentOffset(); } @@ -182,6 +179,10 @@ public: return getInstruction() < CS.getInstruction(); } + bool isCallee(Value::use_iterator UI) const { + return getInstruction()->op_begin() == &UI.getUse(); + } + private: /// Returns the operand number of the first argument unsigned getArgumentOffset() const {