15 #ifndef LLVM_IR_GETELEMENTPTRTYPEITERATOR_H
16 #define LLVM_IR_GETELEMENTPTRTYPEITERATOR_H
29 template<
typename ItTy = User::const_op_iterator>
31 :
public std::iterator<std::forward_iterator_tag, Type *, ptrdiff_t> {
32 typedef std::iterator<std::forward_iterator_tag,
33 Type *, ptrdiff_t> super;
37 enum : uint64_t { Unbounded = -1ull };
38 uint64_t NumElements = Unbounded;
56 return OpIt == x.OpIt;
68 if (
auto *
T = CurTy.dyn_cast<
Type *>())
77 if (
auto *STy = dyn_cast<SequentialType>(Ty)) {
78 CurTy = STy->getElementType();
79 NumElements = STy->getNumElements();
127 auto *GEPOp = cast<GEPOperator>(
GEP);
129 GEPOp->getSourceElementType(),
138 auto &GEPOp = cast<GEPOperator>(
GEP);
140 GEPOp.getSourceElementType(),
149 inline generic_gep_type_iterator<const T *>
155 inline generic_gep_type_iterator<const T *>
162 #endif // LLVM_IR_GETELEMENTPTRTYPEITERATOR_H
Type * getIndexedType() const
generic_gep_type_iterator gep_type_iterator
gep_type_iterator gep_type_end(const User *GEP)
bool isSequential() const
StructType * getStructTypeOrNull() const
Class to represent struct types.
StructType * getStructType() const
bool operator==(const generic_gep_type_iterator &x) const
generic_gep_type_iterator & operator++()
ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory)...
static generic_gep_type_iterator end(ItTy It)
The instances of the Type class are immutable: once they are created, they are never changed...
uint64_t getSequentialNumElements() const
static generic_gep_type_iterator begin(Type *Ty, ItTy It)
bool isBoundedSequential() const
Value * getOperand() const
generic_gep_type_iterator operator++(int)
LLVM_NODISCARD std::enable_if<!is_simple_type< Y >::value, typename cast_retty< X, const Y >::ret_type >::type dyn_cast(const Y &Val)
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
LLVM Value Representation.
bool operator!=(const generic_gep_type_iterator &x) const
static GCRegistry::Add< ErlangGC > A("erlang","erlang-compatible garbage collector")
A discriminated union of two pointer types, with the discriminator in the low bit of the pointer...
gep_type_iterator gep_type_begin(const User *GEP)