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

Chris Lattner sabre at nondot.org
Sat Mar 1 21:32:06 PST 2008


Author: lattner
Date: Sat Mar  1 23:32:05 2008
New Revision: 47814

URL: http://llvm.org/viewvc/llvm-project?rev=47814&view=rev
Log:
make operand accessors const-correct

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=47814&r1=47813&r2=47814&view=diff

==============================================================================
--- llvm/trunk/include/llvm/Instructions.h (original)
+++ llvm/trunk/include/llvm/Instructions.h Sat Mar  1 23:32:05 2008
@@ -1219,7 +1219,11 @@
   }
 
   /// 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];
   }





More information about the llvm-commits mailing list