14#ifndef LLVM_IR_GETELEMENTPTRTYPEITERATOR_H
15#define LLVM_IR_GETELEMENTPTRTYPEITERATOR_H
30template <
typename ItTy = User::const_op_iterator>
91 return OpIt == x.OpIt;
103 if (
auto *
T = dyn_cast_if_present<Type *>(CurTy))
105 if (
auto *VT = dyn_cast_if_present<VectorType *>(CurTy))
106 return VT->getElementType();
107 return cast<StructType *>(CurTy)->getTypeAtIndex(
getOperand());
114 if (
auto *ATy = dyn_cast<ArrayType>(Ty))
115 CurTy = ATy->getElementType();
116 else if (
auto *VTy = dyn_cast<VectorType>(Ty))
119 CurTy = dyn_cast<StructType>(Ty);
145 bool isStruct()
const {
return isa<StructType *>(CurTy); }
146 bool isVector()
const {
return isa<VectorType *>(CurTy); }
158 assert(
DL.typeSizeEqualsStoreSize(ElemTy) &&
"Not byte-addressable");
159 return DL.getTypeStoreSize(ElemTy);
161 return DL.getTypeAllocSize(ElemTy);
167 return dyn_cast_if_present<StructType *>(CurTy);
174 auto *GEPOp = cast<GEPOperator>(
GEP);
176 GEPOp->getSourceElementType(),
177 GEP->op_begin() + 1);
185 auto &GEPOp = cast<GEPOperator>(
GEP);
187 GEPOp.getSourceElementType(),
196 inline generic_gep_type_iterator<const T *>
202 inline generic_gep_type_iterator<const T *>
MachineBasicBlock MachineBasicBlock::iterator DebugLoc DL
static GCRegistry::Add< ErlangGC > A("erlang", "erlang-compatible garbage collector")
This file defines the PointerUnion class, which is a discriminated union of pointer types.
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory),...
A parsed version of the target data layout string in and methods for querying it.
A discriminated union of two or more pointer types, with the discriminator in the low bit of the poin...
Class to represent struct types.
The instances of the Type class are immutable: once they are created, they are never changed.
LLVM Value Representation.
static generic_gep_type_iterator begin(Type *Ty, ItTy It)
bool operator==(const generic_gep_type_iterator &x) const
bool isSequential() const
generic_gep_type_iterator & operator++()
StructType * getStructType() const
StructType * getStructTypeOrNull() const
std::ptrdiff_t difference_type
static generic_gep_type_iterator end(ItTy It)
std::forward_iterator_tag iterator_category
TypeSize getSequentialElementStride(const DataLayout &DL) const
Value * getOperand() const
Type * getIndexedType() const
generic_gep_type_iterator operator++(int)
bool operator!=(const generic_gep_type_iterator &x) const
This is an optimization pass for GlobalISel generic memory operations.
gep_type_iterator gep_type_end(const User *GEP)
gep_type_iterator gep_type_begin(const User *GEP)