15 #ifndef LLVM_IR_GETELEMENTPTRTYPEITERATOR_H
16 #define LLVM_IR_GETELEMENTPTRTYPEITERATOR_H
24 template<
typename ItTy = User::const_op_iterator>
26 :
public std::iterator<std::forward_iterator_tag, Type *, ptrdiff_t> {
27 typedef std::iterator<std::forward_iterator_tag,
28 Type *, ptrdiff_t> super;
38 I.CurTy.setPointer(Ty);
45 I.CurTy.setPointer(Ty);
47 I.AddrSpace = AddrSpace;
58 return OpIt == x.OpIt;
66 return CurTy.getPointer()->getPointerTo(AddrSpace);
67 return CurTy.getPointer();
72 return CurTy.getPointer();
87 dyn_cast<CompositeType>(CurTy.getPointer())) {
88 CurTy.setPointer(CT->getTypeAtIndex(
getOperand()));
90 CurTy.setPointer(
nullptr);
104 auto *GEPOp = cast<GEPOperator>(
GEP);
106 GEPOp->getSourceElementType(),
107 cast<PointerType>(GEPOp->getPointerOperandType()->getScalarType())
115 auto &GEPOp = cast<GEPOperator>(
GEP);
117 GEPOp.getSourceElementType(),
118 cast<PointerType>(GEPOp.getPointerOperandType()->getScalarType())
127 inline generic_gep_type_iterator<const T *>
133 inline generic_gep_type_iterator<const T *>
Type * getIndexedType() const
generic_gep_type_iterator gep_type_iterator
gep_type_iterator gep_type_end(const User *GEP)
Type * operator->() 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)
PointerIntPair - This class implements a pair of a pointer and small integer.
The instances of the Type class are immutable: once they are created, they are never changed...
Type * getTypeAtIndex(const Value *V)
getTypeAtIndex - Given an index value into the type, return the type of the element.
static generic_gep_type_iterator begin(Type *Ty, ItTy It)
static generic_gep_type_iterator begin(Type *Ty, unsigned AddrSpace, ItTy It)
CompositeType - Common super class of ArrayType, StructType, PointerType and VectorType.
Value * getOperand() const
generic_gep_type_iterator operator++(int)
LLVM Value Representation.
bool operator!=(const generic_gep_type_iterator &x) const
gep_type_iterator gep_type_begin(const User *GEP)