extend ArgOperand interface: setArgOperand

(in both CallInst and InvokeInst)

also add a (short-lived) constant to CallInst, that names
the operand index of the first call argument. This is
strictly transitional and should not be used for new code.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@107001 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Gabor Greif 2010-06-28 12:23:36 +00:00
parent 19101c7585
commit 710ac0711f

View File

@ -943,8 +943,10 @@ public:
/// Provide fast operand accessors
DECLARE_TRANSPARENT_OPERAND_ACCESSORS(Value);
enum { ArgOffset = 1 }; ///< temporary, do not use for new code!
unsigned getNumArgOperands() const { return getNumOperands() - 1; }
Value *getArgOperand(unsigned i) const { return getOperand(i + 1); }
Value *getArgOperand(unsigned i) const { return getOperand(i + ArgOffset); }
void setArgOperand(unsigned i, Value *v) { setOperand(i + ArgOffset, v); }
/// getCallingConv/setCallingConv - Get or set the calling convention of this
/// function call.
@ -2440,6 +2442,7 @@ public:
unsigned getNumArgOperands() const { return getNumOperands() - 3; }
Value *getArgOperand(unsigned i) const { return getOperand(i); }
void setArgOperand(unsigned i, Value *v) { setOperand(i, v); }
/// getCallingConv/setCallingConv - Get or set the calling convention of this
/// function call.