mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2025-02-04 03:06:28 +00:00
Add support for setting parameters to CallSite.
llvm-svn: 47249
This commit is contained in:
parent
48dd6a0f96
commit
b0dee942db
@ -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;
|
||||
|
Loading…
x
Reference in New Issue
Block a user