14#ifndef LLVM_IR_GETELEMENTPTRTYPEITERATOR_H
15#define LLVM_IR_GETELEMENTPTRTYPEITERATOR_H
30template <
typename ItTy = User::const_op_iterator>
59 return OpIt == x.OpIt;
71 if (
auto *
T = dyn_cast_if_present<Type *>(CurTy))
73 return cast<StructType *>(CurTy)->getTypeAtIndex(
getOperand());
80 if (
auto *ATy = dyn_cast<ArrayType>(Ty))
81 CurTy = ATy->getElementType();
82 else if (
auto *VTy = dyn_cast<VectorType>(Ty))
83 CurTy = VTy->getElementType();
85 CurTy = dyn_cast<StructType>(Ty);
111 bool isStruct()
const {
return isa<StructType *>(CurTy); }
117 return dyn_cast_if_present<StructType *>(CurTy);
124 auto *GEPOp = cast<GEPOperator>(
GEP);
126 GEPOp->getSourceElementType(),
127 GEP->op_begin() + 1);
135 auto &GEPOp = cast<GEPOperator>(
GEP);
137 GEPOp.getSourceElementType(),
146 inline generic_gep_type_iterator<const T *>
152 inline generic_gep_type_iterator<const T *>
static GCRegistry::Add< ErlangGC > A("erlang", "erlang-compatible garbage collector")
This file defines the PointerUnion class, which is a discriminated union of pointer types.
ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory),...
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
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)