summaryrefslogtreecommitdiffstats
path: root/include/llvm/Instructions.h
diff options
context:
space:
mode:
authorDan Gohman <gohman@apple.com>2008-05-31 19:09:08 +0000
committerDan Gohman <gohman@apple.com>2008-05-31 19:09:08 +0000
commit35651cdf0bbd474349e680a341dbf235bcdb4608 (patch)
treecdcde8d2d7885ae06eb6eb760479fefce94c7695 /include/llvm/Instructions.h
parent517e1f5cd752e06e1587804f4e1d64ef52a21a08 (diff)
downloadexternal_llvm-35651cdf0bbd474349e680a341dbf235bcdb4608.zip
external_llvm-35651cdf0bbd474349e680a341dbf235bcdb4608.tar.gz
external_llvm-35651cdf0bbd474349e680a341dbf235bcdb4608.tar.bz2
Fix some bugs with the handling of indices in insertvalue/extractvalue.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51820 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/Instructions.h')
-rw-r--r--include/llvm/Instructions.h20
1 files changed, 8 insertions, 12 deletions
diff --git a/include/llvm/Instructions.h b/include/llvm/Instructions.h
index 2e69243..9393ec4 100644
--- a/include/llvm/Instructions.h
+++ b/include/llvm/Instructions.h
@@ -1590,10 +1590,8 @@ public:
}
static const Type *getIndexedType(const Type *Ptr, unsigned Idx);
- inline op_iterator idx_begin() { return op_begin()+1; }
- inline const_op_iterator idx_begin() const { return op_begin()+1; }
- inline op_iterator idx_end() { return op_end(); }
- inline const_op_iterator idx_end() const { return op_end(); }
+ inline const unsigned *idx_begin() const { return Indices.begin(); }
+ inline const unsigned *idx_end() const { return Indices.end(); }
Value *getAggregateOperand() {
return getOperand(0);
@@ -1606,11 +1604,11 @@ public:
}
unsigned getNumIndices() const { // Note: always non-negative
- return getNumOperands() - 1;
+ return Indices.size();
}
bool hasIndices() const {
- return getNumOperands() > 1;
+ return true;
}
// Methods for support type inquiry through isa, cast, and dyn_cast:
@@ -1762,10 +1760,8 @@ public:
return reinterpret_cast<const PointerType*>(Instruction::getType());
}
- inline unsigned *idx_begin() { return Indices.begin(); }
- inline const unsigned *idx_begin() const { return Indices.begin(); }
- inline unsigned *idx_end() { return Indices.end(); }
- inline const unsigned *idx_end() const { return Indices.end(); }
+ inline const unsigned *idx_begin() const { return Indices.begin(); }
+ inline const unsigned *idx_end() const { return Indices.end(); }
Value *getAggregateOperand() {
return getOperand(0);
@@ -1788,11 +1784,11 @@ public:
}
unsigned getNumIndices() const { // Note: always non-negative
- return getNumOperands() - 2;
+ return Indices.size();
}
bool hasIndices() const {
- return getNumOperands() > 2;
+ return true;
}
// Methods for support type inquiry through isa, cast, and dyn_cast: