From: Owen Anderson Date: Mon, 18 Feb 2008 00:10:55 +0000 (+0000) Subject: Add support for setting parameters to CallSite. X-Git-Url: http://plrg.eecs.uci.edu/git/?a=commitdiff_plain;h=823391ae6efffa3ec317c58f8f98ddd1075f12b5;p=oota-llvm.git Add support for setting parameters to CallSite. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47249 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/include/llvm/Support/CallSite.h b/include/llvm/Support/CallSite.h index f7d8db60860..7e95e5db7b6 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;