From 4fa01441d5946c177e7d20cd454c09662c242c03 Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Sun, 2 Mar 2008 05:32:05 +0000 Subject: [PATCH] make operand accessors const-correct git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47814 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/llvm/Instructions.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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]; }