git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@109821
91177308-0d34-0410-b5e6-
96231b3b80d8
ValTy *getArgument(unsigned ArgNo) const {
assert(arg_begin() + ArgNo < arg_end() && "Argument # out of range!");
ValTy *getArgument(unsigned ArgNo) const {
assert(arg_begin() + ArgNo < arg_end() && "Argument # out of range!");
- return *(arg_begin()+ArgNo);
+ return *(arg_begin() + ArgNo);
}
void setArgument(unsigned ArgNo, Value* newVal) {
assert(getInstruction() && "Not a call or invoke instruction!");
assert(arg_begin() + ArgNo < arg_end() && "Argument # out of range!");
}
void setArgument(unsigned ArgNo, Value* newVal) {
assert(getInstruction() && "Not a call or invoke instruction!");
assert(arg_begin() + ArgNo < arg_end() && "Argument # out of range!");
- getInstruction()->setOperand(getArgumentOffset() + ArgNo, newVal);
+ getInstruction()->setOperand(ArgNo, newVal);
}
/// Given a value use iterator, returns the argument that corresponds to it.
}
/// Given a value use iterator, returns the argument that corresponds to it.
IterTy arg_begin() const {
assert(getInstruction() && "Not a call or invoke instruction!");
// Skip non-arguments
IterTy arg_begin() const {
assert(getInstruction() && "Not a call or invoke instruction!");
// Skip non-arguments
- return (*this)->op_begin() + getArgumentOffset();
+ return (*this)->op_begin();
}
IterTy arg_end() const { return (*this)->op_end() - getArgumentEndOffset(); }
}
IterTy arg_end() const { return (*this)->op_end() - getArgumentEndOffset(); }
- /// Returns the operand number of the first argument
- /// FIXME: remove this func!
- unsigned getArgumentOffset() const {
- return 0; // Args are at the front
- }
-
unsigned getArgumentEndOffset() const {
if (isCall())
return 1; // Skip Callee
unsigned getArgumentEndOffset() const {
if (isCall())
return 1; // Skip Callee