make operand accessors const-correct
authorChris Lattner <sabre@nondot.org>
Sun, 2 Mar 2008 05:32:05 +0000 (05:32 +0000)
committerChris Lattner <sabre@nondot.org>
Sun, 2 Mar 2008 05:32:05 +0000 (05:32 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47814 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/Instructions.h

index a7fe6a0ac7459c606f38f33ff8d038ea49383202..2e6b85b729b18cb50b15a736b65b63ffafac1cca 100644 (file)
@@ -1219,7 +1219,11 @@ public:
   }
 
   /// Transparently provide more efficient getOperand methods.
-  Value *getOperand(unsigned i) const {
+  const Value *getOperand(unsigned i) const {
+    assert(i < 3 && "getOperand() out of range!");
+    return Ops[i];
+  }
+  Value *getOperand(unsigned i) {
     assert(i < 3 && "getOperand() out of range!");
     return Ops[i];
   }