14#ifndef LLVM_IR_GETELEMENTPTRTYPEITERATOR_H
15#define LLVM_IR_GETELEMENTPTRTYPEITERATOR_H
30template <
typename ItTy = User::const_op_iterator>
31class generic_gep_type_iterator {
68 generic_gep_type_iterator() =
default;
78 generic_gep_type_iterator
I;
84 static generic_gep_type_iterator
end(
ItTy It) {
85 generic_gep_type_iterator
I;
90 bool operator==(
const generic_gep_type_iterator &x)
const {
91 return OpIt == x.OpIt;
94 bool operator!=(
const generic_gep_type_iterator &x)
const {
106 return VT->getElementType();
115 CurTy = ATy->getElementType();
125 generic_gep_type_iterator tmp = *
this;
158 assert(
DL.typeSizeEqualsStoreSize(ElemTy) &&
"Not byte-addressable");
159 return DL.getTypeStoreSize(ElemTy);
161 return DL.getTypeAllocSize(ElemTy);
176 GEPOp->getSourceElementType(),
177 GEP->op_begin() + 1);
187 GEPOp.getSourceElementType(),
196 inline generic_gep_type_iterator<const T *>
202 inline generic_gep_type_iterator<const T *>
assert(UImm &&(UImm !=~static_cast< T >(0)) &&"Invalid immediate!")
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.
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.
decltype(auto) dyn_cast(const From &Val)
dyn_cast<X> - Return the argument parameter cast to the specified type.
auto dyn_cast_if_present(const Y &Val)
dyn_cast_if_present<X> - Functionally identical to dyn_cast, except that a null (or none in the case ...
gep_type_iterator gep_type_end(const User *GEP)
generic_gep_type_iterator<> gep_type_iterator
bool isa(const From &Val)
isa<X> - Return true if the parameter to the template is an instance of one of the template type argu...
decltype(auto) cast(const From &Val)
cast<X> - Return the argument parameter cast to the specified type.
gep_type_iterator gep_type_begin(const User *GEP)