aboutsummaryrefslogtreecommitdiff
path: root/llvm/include/llvm/IR/GetElementPtrTypeIterator.h
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/include/llvm/IR/GetElementPtrTypeIterator.h')
-rw-r--r--llvm/include/llvm/IR/GetElementPtrTypeIterator.h22
1 files changed, 3 insertions, 19 deletions
diff --git a/llvm/include/llvm/IR/GetElementPtrTypeIterator.h b/llvm/include/llvm/IR/GetElementPtrTypeIterator.h
index ed854e458da2..1fa996229749 100644
--- a/llvm/include/llvm/IR/GetElementPtrTypeIterator.h
+++ b/llvm/include/llvm/IR/GetElementPtrTypeIterator.h
@@ -32,8 +32,6 @@ class generic_gep_type_iterator {
ItTy OpIt;
PointerUnion<StructType *, Type *> CurTy;
- enum : uint64_t { Unbounded = -1ull };
- uint64_t NumElements = Unbounded;
generic_gep_type_iterator() = default;
@@ -79,16 +77,11 @@ public:
generic_gep_type_iterator &operator++() { // Preincrement
Type *Ty = getIndexedType();
- if (auto *ATy = dyn_cast<ArrayType>(Ty)) {
+ if (auto *ATy = dyn_cast<ArrayType>(Ty))
CurTy = ATy->getElementType();
- NumElements = ATy->getNumElements();
- } else if (auto *VTy = dyn_cast<VectorType>(Ty)) {
+ else if (auto *VTy = dyn_cast<VectorType>(Ty))
CurTy = VTy->getElementType();
- if (isa<ScalableVectorType>(VTy))
- NumElements = Unbounded;
- else
- NumElements = cast<FixedVectorType>(VTy)->getNumElements();
- } else
+ else
CurTy = dyn_cast<StructType>(Ty);
++OpIt;
return *this;
@@ -123,15 +116,6 @@ public:
StructType *getStructTypeOrNull() const {
return CurTy.dyn_cast<StructType *>();
}
-
- bool isBoundedSequential() const {
- return isSequential() && NumElements != Unbounded;
- }
-
- uint64_t getSequentialNumElements() const {
- assert(isBoundedSequential());
- return NumElements;
- }
};
using gep_type_iterator = generic_gep_type_iterator<>;