add accessors
authorChris Lattner <sabre@nondot.org>
Sat, 31 Jan 2009 07:34:19 +0000 (07:34 +0000)
committerChris Lattner <sabre@nondot.org>
Sat, 31 Jan 2009 07:34:19 +0000 (07:34 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@63478 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/User.h

index 919693e082925582cd3e6a756a8cabf8fee1efff..e25d19b563fe92f571986ff0c83e0eefe190856a 100644 (file)
@@ -100,6 +100,15 @@ public:
            "Cannot mutate a constant with setOperand!");
     OperandList[i] = Val;
   }
+  const Use &getOperandUse(unsigned i) const {
+    assert(i < NumOperands && "getOperand() out of range!");
+    return OperandList[i];
+  }
+  Use &getOperandUse(unsigned i) {
+    assert(i < NumOperands && "getOperand() out of range!");
+    return OperandList[i];
+  }
+  
   unsigned getNumOperands() const { return NumOperands; }
 
   // ---------------------------------------------------------------------------