aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2008-03-02 05:32:05 +0000
committerChris Lattner <sabre@nondot.org>2008-03-02 05:32:05 +0000
commit4fa01441d5946c177e7d20cd454c09662c242c03 (patch)
treeda32d615a5a293ccae8ce88555c767e02284e6bf /include
parent8728f1915f332f09112848c6d30055be5b943ba5 (diff)
make operand accessors const-correct
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47814 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include')
-rw-r--r--include/llvm/Instructions.h6
1 files changed, 5 insertions, 1 deletions
diff --git a/include/llvm/Instructions.h b/include/llvm/Instructions.h
index a7fe6a0ac7..2e6b85b729 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];
}