// NOTE: This class is supposed to have "value semantics". So it should be
// passed by value, not by reference; it should not be "new"ed or "delete"d. It
// is efficiently copyable, assignable and constructable, with cost equivalent
-// to copying a pointer. (You will notice that it has only a single data
-// member.)
+// to copying a pointer (notice that it has only a single data member).
//
//===----------------------------------------------------------------------===//
/// getType - Return the type of the instruction that generated this call site
///
- const Type *getType () const { return I->getType (); }
+ const Type *getType() const { return I->getType(); }
/// getInstruction - Return the instruction this call site corresponds to
///
I->setOperand(0, V);
}
+ Value *getArgument(unsigned ArgNo) const {
+ assert(arg_begin() + ArgNo < arg_end() && "Argument # out of range!");
+ return *(arg_begin()+ArgNo);
+ }
+
/// arg_iterator - The type of iterator to use when looping over actual
/// arguments at this call site...
typedef User::op_iterator arg_iterator;
return I->op_begin()+3; // Skip Function, BB, BB
}
arg_iterator arg_end() const { return I->op_end(); }
- unsigned arg_size() const { return arg_end() - arg_begin(); }
+ unsigned arg_size() const { return unsigned(arg_end() - arg_begin()); }
bool operator<(const CallSite &CS) const {
return getInstruction() < CS.getInstruction();