LLVM: include/llvm/IR/GetElementPtrTypeIterator.h Source File (original) (raw)
1
2
3
4
5
6
7
8
9
10
11
12
13
14#ifndef LLVM_IR_GETELEMENTPTRTYPEITERATOR_H
15#define LLVM_IR_GETELEMENTPTRTYPEITERATOR_H
16
24#include
25#include
26#include
27
28namespace llvm {
29
30template
31class generic_gep_type_iterator {
32
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
67
68 generic_gep_type_iterator() = default;
69
70public:
76
77 static generic_gep_type_iterator begin(Type *Ty, ItTy It) {
78 generic_gep_type_iterator I;
79 I.CurTy = Ty;
80 I.OpIt = It;
81 return I;
82 }
83
84 static generic_gep_type_iterator end(ItTy It) {
85 generic_gep_type_iterator I;
86 I.OpIt = It;
87 return I;
88 }
89
90 bool operator==(const generic_gep_type_iterator &x) const {
91 return OpIt == x.OpIt;
92 }
93
94 bool operator!=(const generic_gep_type_iterator &x) const {
96 }
97
98
99
100
101
104 return T;
106 return VT->getElementType();
108 }
109
111
112 generic_gep_type_iterator &operator++() {
115 CurTy = ATy->getElementType();
117 CurTy = VTy;
118 else
120 ++OpIt;
121 return *this;
122 }
123
124 generic_gep_type_iterator operator++(int) {
125 generic_gep_type_iterator tmp = *this;
126 ++*this;
127 return tmp;
128 }
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
148
149
150
151
152
153
158 assert(DL.typeSizeEqualsStoreSize(ElemTy) && "Not byte-addressable");
159 return DL.getTypeStoreSize(ElemTy);
160 }
161 return DL.getTypeAllocSize(ElemTy);
162 }
163
165
169};
170
172
176 GEPOp->getSourceElementType(),
177 GEP->op_begin() + 1);
178 }
179
183
187 GEPOp.getSourceElementType(),
188 GEP.op_begin() + 1);
189 }
190
194
195 template
196 inline generic_gep_type_iterator<const T *>
200
201 template
202 inline generic_gep_type_iterator<const T *>
206
207}
208
209#endif
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.
bool isVector() const
Definition GetElementPtrTypeIterator.h:146
static generic_gep_type_iterator begin(Type *Ty, ItTy It)
Definition GetElementPtrTypeIterator.h:77
bool operator==(const generic_gep_type_iterator &x) const
Definition GetElementPtrTypeIterator.h:90
value_type & reference
Definition GetElementPtrTypeIterator.h:75
bool isSequential() const
Definition GetElementPtrTypeIterator.h:147
generic_gep_type_iterator & operator++()
Definition GetElementPtrTypeIterator.h:112
StructType * getStructType() const
Definition GetElementPtrTypeIterator.h:164
StructType * getStructTypeOrNull() const
Definition GetElementPtrTypeIterator.h:166
std::ptrdiff_t difference_type
Definition GetElementPtrTypeIterator.h:73
bool isStruct() const
Definition GetElementPtrTypeIterator.h:145
static generic_gep_type_iterator end(ItTy It)
Definition GetElementPtrTypeIterator.h:84
Type * value_type
Definition GetElementPtrTypeIterator.h:72
std::forward_iterator_tag iterator_category
Definition GetElementPtrTypeIterator.h:71
value_type * pointer
Definition GetElementPtrTypeIterator.h:74
TypeSize getSequentialElementStride(const DataLayout &DL) const
Definition GetElementPtrTypeIterator.h:154
Value * getOperand() const
Definition GetElementPtrTypeIterator.h:110
Type * getIndexedType() const
Definition GetElementPtrTypeIterator.h:102
generic_gep_type_iterator operator++(int)
Definition GetElementPtrTypeIterator.h:124
bool operator!=(const generic_gep_type_iterator &x) const
Definition GetElementPtrTypeIterator.h:94
This is an optimization pass for GlobalISel generic memory operations.
decltype(auto) dyn_cast(const From &Val)
dyn_cast - Return the argument parameter cast to the specified type.
auto dyn_cast_if_present(const Y &Val)
dyn_cast_if_present - Functionally identical to dyn_cast, except that a null (or none in the case ...
gep_type_iterator gep_type_end(const User *GEP)
Definition GetElementPtrTypeIterator.h:180
generic_gep_type_iterator<> gep_type_iterator
Definition GetElementPtrTypeIterator.h:171
bool isa(const From &Val)
isa - 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 - Return the argument parameter cast to the specified type.
gep_type_iterator gep_type_begin(const User *GEP)
Definition GetElementPtrTypeIterator.h:173