aboutsummaryrefslogtreecommitdiffstats
path: root/include/llvm
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2004-11-13 23:28:10 +0000
committerChris Lattner <sabre@nondot.org>2004-11-13 23:28:10 +0000
commite6c745261ea2c4c523cb66f8935f6eceeab1c5ec (patch)
treec3b7687623335c016344943165bf1c9df10fe9d4 /include/llvm
parent4b2c09fa2226010285937c0d402a556f3b38f9f8 (diff)
downloadexternal_llvm-e6c745261ea2c4c523cb66f8935f6eceeab1c5ec.zip
external_llvm-e6c745261ea2c4c523cb66f8935f6eceeab1c5ec.tar.gz
external_llvm-e6c745261ea2c4c523cb66f8935f6eceeab1c5ec.tar.bz2
Add useful method, minor cleanups
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17715 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm')
-rw-r--r--include/llvm/Support/CallSite.h10
1 files changed, 7 insertions, 3 deletions
diff --git a/include/llvm/Support/CallSite.h b/include/llvm/Support/CallSite.h
index 45d2832..9344263 100644
--- a/include/llvm/Support/CallSite.h
+++ b/include/llvm/Support/CallSite.h
@@ -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 @@ public:
/// 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 @@ public:
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;