From: Chris Lattner Date: Sun, 2 Mar 2008 05:32:05 +0000 (+0000) Subject: make operand accessors const-correct X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=4fa01441d5946c177e7d20cd454c09662c242c03;p=oota-llvm.git make operand accessors const-correct git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47814 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/include/llvm/Instructions.h b/include/llvm/Instructions.h index a7fe6a0ac74..2e6b85b729b 100644 --- a/include/llvm/Instructions.h +++ b/include/llvm/Instructions.h @@ -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]; }