File tree Expand file tree Collapse file tree 11 files changed +70
-25
lines changed Expand file tree Collapse file tree 11 files changed +70
-25
lines changed Original file line number Diff line number Diff line change @@ -520,11 +520,16 @@ class SDKNodeVectorViewer {
520
520
ViewerIterator end ();
521
521
};
522
522
523
- class SDKNodeVectorViewer ::ViewerIterator :
524
- public std::iterator<std::input_iterator_tag, VectorIt> {
523
+ class SDKNodeVectorViewer ::ViewerIterator {
525
524
SDKNodeVectorViewer &Viewer;
526
525
VectorIt P;
527
526
public:
527
+ using iterator_category = std::forward_iterator_tag;
528
+ using value_type = VectorIt;
529
+ using difference_type = std::ptrdiff_t ;
530
+ using pointer = value_type*;
531
+ using reference = value_type&;
532
+
528
533
ViewerIterator (SDKNodeVectorViewer &Viewer, VectorIt P) : Viewer(Viewer), P(P) {}
529
534
ViewerIterator (const ViewerIterator& mit) : Viewer(mit.Viewer), P(mit.P) {}
530
535
ViewerIterator& operator ++();
Original file line number Diff line number Diff line change @@ -2377,9 +2377,15 @@ class DeclAttributes {
2377
2377
const Decl *D = nullptr );
2378
2378
2379
2379
template <typename T, typename DERIVED>
2380
- class iterator_base : public std ::iterator<std::forward_iterator_tag, T *> {
2380
+ class iterator_base {
2381
2381
T *Impl;
2382
2382
public:
2383
+ using iterator_category = std::forward_iterator_tag;
2384
+ using value_type = T*;
2385
+ using difference_type = std::ptrdiff_t ;
2386
+ using pointer = value_type*;
2387
+ using reference = value_type&;
2388
+
2383
2389
explicit iterator_base (T *Impl) : Impl(Impl) {}
2384
2390
DERIVED &operator ++() { Impl = Impl->Next ; return (DERIVED&)*this ; }
2385
2391
bool operator ==(const iterator_base &X) const { return X.Impl == Impl; }
@@ -2678,11 +2684,16 @@ class TypeAttributes {
2678
2684
}
2679
2685
2680
2686
// Iterator for the custom type attributes.
2681
- class iterator
2682
- : public std::iterator<std::forward_iterator_tag, CustomAttr *> {
2687
+ class iterator {
2683
2688
CustomAttr *attr;
2684
2689
2685
2690
public:
2691
+ using iterator_category = std::forward_iterator_tag;
2692
+ using value_type = CustomAttr*;
2693
+ using difference_type = std::ptrdiff_t ;
2694
+ using pointer = value_type*;
2695
+ using reference = value_type&;
2696
+
2686
2697
iterator () : attr(nullptr ) { }
2687
2698
explicit iterator (CustomAttr *attr) : attr(attr) { }
2688
2699
Original file line number Diff line number Diff line change @@ -143,9 +143,12 @@ class FrozenMultiMap {
143
143
unsigned size () const { return storage.size (); }
144
144
bool empty () const { return storage.empty (); }
145
145
146
- struct iterator
147
- : std::iterator<std::forward_iterator_tag,
148
- std::pair<Key, Optional<PairToSecondEltRange>>> {
146
+ struct iterator {
147
+ using iterator_category = std::forward_iterator_tag;
148
+ using value_type = std::pair<Key, Optional<PairToSecondEltRange>>;
149
+ using difference_type = std::ptrdiff_t ;
150
+ using pointer = value_type*;
151
+ using reference = value_type&;
149
152
using base_iterator = typename decltype (storage)::iterator;
150
153
151
154
FrozenMultiMap ↦
Original file line number Diff line number Diff line change @@ -87,14 +87,19 @@ class ReflectionSection {
87
87
};
88
88
89
89
template <typename Self, typename Descriptor>
90
- class ReflectionSectionIteratorBase
91
- : public std::iterator<std::forward_iterator_tag, Descriptor> {
90
+ class ReflectionSectionIteratorBase {
92
91
uint64_t OriginalSize;
93
92
protected:
94
93
Self &asImpl () {
95
94
return *static_cast <Self *>(this );
96
95
}
97
96
public:
97
+ using iterator_category = std::forward_iterator_tag;
98
+ using value_type = Descriptor;
99
+ using difference_type = std::ptrdiff_t ;
100
+ using pointer = value_type*;
101
+ using reference = value_type&;
102
+
98
103
RemoteRef<void > Cur;
99
104
uint64_t Size;
100
105
std::string Name;
Original file line number Diff line number Diff line change @@ -65,9 +65,15 @@ inline void deleteAllDebugUses(SILInstruction *inst) {
65
65
// / of uses, provided by the underlying ValueBaseUseIterator.
66
66
// / If \p nonDebugInsts is true, then the iterator provides a view to all non-
67
67
// / debug instructions. Otherwise it provides a view ot all debug-instructions.
68
- template <bool nonDebugInsts> class DebugUseIterator
69
- : public std::iterator<std::forward_iterator_tag, Operand *, ptrdiff_t > {
70
-
68
+ template <bool nonDebugInsts> class DebugUseIterator {
69
+ public:
70
+ using iterator_category = std::forward_iterator_tag;
71
+ using value_type = Operand*;
72
+ using difference_type = std::ptrdiff_t ;
73
+ using pointer = value_type*;
74
+ using reference = value_type&;
75
+
76
+ private:
71
77
ValueBaseUseIterator BaseIterator;
72
78
73
79
// Skip any debug or non-debug instructions (depending on the nonDebugInsts
Original file line number Diff line number Diff line change @@ -1160,11 +1160,16 @@ inline SILValue getSILValueType(const Operand &op) {
1160
1160
using OperandValueArrayRef = ArrayRefView<Operand, SILValue, getSILValueType>;
1161
1161
1162
1162
// / An iterator over all uses of a ValueBase.
1163
- class ValueBaseUseIterator : public std ::iterator<std::forward_iterator_tag,
1164
- Operand*, ptrdiff_t > {
1163
+ class ValueBaseUseIterator {
1165
1164
protected:
1166
1165
Operand *Cur;
1167
1166
public:
1167
+ using iterator_category = std::forward_iterator_tag;
1168
+ using value_type = Operand*;
1169
+ using difference_type = std::ptrdiff_t ;
1170
+ using pointer = value_type*;
1171
+ using reference = value_type&;
1172
+
1168
1173
ValueBaseUseIterator () = default ;
1169
1174
explicit ValueBaseUseIterator (Operand *cur) : Cur(cur) {}
1170
1175
Operand *operator ->() const { return Cur; }
Original file line number Diff line number Diff line change @@ -173,7 +173,7 @@ class ClosureFunctionOrder {
173
173
174
174
ArrayRef<SILFunction *> getTopDownFunctions () const {
175
175
assert (!topDownFunctions.empty ()
176
- || llvm::empty ( csa->getModule ()->getFunctions ()));
176
+ || csa->getModule ()->getFunctions (). empty ( ));
177
177
return topDownFunctions;
178
178
}
179
179
Original file line number Diff line number Diff line change @@ -237,8 +237,7 @@ class LoopRegion {
237
237
238
238
// / An iterator that knows how to iterate over the subregion indices of a
239
239
// / region.
240
- class subregion_iterator :
241
- public std::iterator<std::bidirectional_iterator_tag, unsigned > {
240
+ class subregion_iterator {
242
241
friend struct SubregionData ;
243
242
llvm::SmallVectorImpl<SubregionID>::const_iterator InnerIter;
244
243
const llvm::SmallVectorImpl<std::pair<unsigned , unsigned >> *Subloops;
@@ -323,8 +322,7 @@ class LoopRegion {
323
322
324
323
// / An iterator that knows how to iterate over the backedge indices of a
325
324
// / region.
326
- class backedge_iterator
327
- : public std::iterator<std::bidirectional_iterator_tag, unsigned > {
325
+ class backedge_iterator {
328
326
friend struct SubregionData ;
329
327
using InnerIterTy = llvm::SmallVectorImpl<unsigned >::const_iterator;
330
328
llvm::Optional<InnerIterTy> InnerIter;
Original file line number Diff line number Diff line change @@ -288,8 +288,15 @@ void insertDeallocOfCapturedArguments(
288
288
// / users of the looked through builtin expect instruction i.e it presents a
289
289
// / view that shows all users as if there were no builtin expect instructions
290
290
// / interposed.
291
- class IgnoreExpectUseIterator
292
- : public std::iterator<std::forward_iterator_tag, Operand *, ptrdiff_t > {
291
+ class IgnoreExpectUseIterator {
292
+ public:
293
+ using iterator_category = std::forward_iterator_tag;
294
+ using value_type = Operand*;
295
+ using difference_type = std::ptrdiff_t ;
296
+ using pointer = value_type*;
297
+ using reference = value_type&;
298
+
299
+ private:
293
300
ValueBaseUseIterator origUseChain;
294
301
ValueBaseUseIterator currentIter;
295
302
Original file line number Diff line number Diff line change @@ -689,7 +689,7 @@ static void printDifferentiableAttrArguments(
689
689
return false ;
690
690
return true ;
691
691
});
692
- if (!llvm:: empty (requirementsToPrint )) {
692
+ if (!requirementsToPrint. empty ()) {
693
693
if (!isLeadingClause)
694
694
stream << ' ' ;
695
695
stream << " where " ;
You can’t perform that action at this time.
0 commit comments