extend ArgOperand interface: setArgOperand
authorGabor Greif <ggreif@gmail.com>
Mon, 28 Jun 2010 12:23:36 +0000 (12:23 +0000)
committerGabor Greif <ggreif@gmail.com>
Mon, 28 Jun 2010 12:23:36 +0000 (12:23 +0000)
(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

include/llvm/Instructions.h

index 6e6a1a6a559d39ecf65e007674bf2b3736baa9d8..29c36e0e4496d1bfa814601addf95120a61a381c 100644 (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.