[llvm-commits] [llvm] r107001 - /llvm/trunk/include/llvm/Instructions.h

Gabor Greif ggreif at gmail.com
Mon Jun 28 05:23:36 PDT 2010


Author: ggreif
Date: Mon Jun 28 07:23:36 2010
New Revision: 107001

URL: http://llvm.org/viewvc/llvm-project?rev=107001&view=rev
Log:
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.

Modified:
    llvm/trunk/include/llvm/Instructions.h

Modified: llvm/trunk/include/llvm/Instructions.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Instructions.h?rev=107001&r1=107000&r2=107001&view=diff
==============================================================================
--- llvm/trunk/include/llvm/Instructions.h (original)
+++ llvm/trunk/include/llvm/Instructions.h Mon Jun 28 07:23:36 2010
@@ -943,8 +943,10 @@
   /// 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 @@
 
   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.





More information about the llvm-commits mailing list