[llvm-commits] CVS: llvm/include/llvm/Support/CallSite.h

Chris Lattner lattner at cs.uiuc.edu
Sat Nov 13 15:28:22 PST 2004



Changes in directory llvm/include/llvm/Support:

CallSite.h updated: 1.15 -> 1.16
---
Log message:

Add useful method, minor cleanups


---
Diffs of the changes:  (+7 -3)

Index: llvm/include/llvm/Support/CallSite.h
diff -u llvm/include/llvm/Support/CallSite.h:1.15 llvm/include/llvm/Support/CallSite.h:1.16
--- llvm/include/llvm/Support/CallSite.h:1.15	Fri Jun  4 19:17:13 2004
+++ llvm/include/llvm/Support/CallSite.h	Sat Nov 13 17:28:10 2004
@@ -13,8 +13,7 @@
 // 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).
 //
 //===----------------------------------------------------------------------===//
 
@@ -55,7 +54,7 @@
 
   /// 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
   ///
@@ -85,6 +84,11 @@
     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;






More information about the llvm-commits mailing list