aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOwen Anderson <resistor@mac.com>2008-02-18 00:10:55 +0000
committerOwen Anderson <resistor@mac.com>2008-02-18 00:10:55 +0000
commit823391ae6efffa3ec317c58f8f98ddd1075f12b5 (patch)
tree318d8b2187c98af70b7fcf7bf9a9382f67f45e33
parent7d54254c9cc6e5a3be3a7d9d22241c0ae8a7fa03 (diff)
Add support for setting parameters to CallSite.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47249 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--include/llvm/Support/CallSite.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/include/llvm/Support/CallSite.h b/include/llvm/Support/CallSite.h
index f7d8db6086..7e95e5db7b 100644
--- a/include/llvm/Support/CallSite.h
+++ b/include/llvm/Support/CallSite.h
@@ -114,6 +114,15 @@ public:
return *(arg_begin()+ArgNo);
}
+ void setArgument(unsigned ArgNo, Value* newVal) {
+ assert(I && "Not a call or invoke instruction!");
+ assert(arg_begin() + ArgNo < arg_end() && "Argument # out of range!");
+ if (I->getOpcode() == Instruction::Call)
+ I->setOperand(ArgNo+1, newVal); // Skip Function
+ else
+ I->setOperand(ArgNo+3, newVal); // Skip Function, BB, BB
+ }
+
/// arg_iterator - The type of iterator to use when looping over actual
/// arguments at this call site...
typedef User::op_iterator arg_iterator;