#include "llvm/Attributes.h"
#include "llvm/ADT/PointerIntPair.h"
#include "llvm/BasicBlock.h"
+#include "llvm/CallingConv.h"
#include "llvm/Instruction.h"
namespace llvm {
CallSite(CallInst *CI) : I(reinterpret_cast<Instruction*>(CI), true) {}
CallSite(InvokeInst *II) : I(reinterpret_cast<Instruction*>(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
/// 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.
/// 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();
}
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 {