LLVM 20.0.0git
SmallPtrSet.h
Go to the documentation of this file.
1//===- llvm/ADT/SmallPtrSet.h - 'Normally small' pointer set ----*- C++ -*-===//
2//
3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4// See https://llvm.org/LICENSE.txt for license information.
5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6//
7//===----------------------------------------------------------------------===//
8///
9/// \file
10/// This file defines the SmallPtrSet class. See the doxygen comment for
11/// SmallPtrSetImplBase for more details on the algorithm used.
12//
13//===----------------------------------------------------------------------===//
14
15#ifndef LLVM_ADT_SMALLPTRSET_H
16#define LLVM_ADT_SMALLPTRSET_H
17
22#include <algorithm>
23#include <cassert>
24#include <cstddef>
25#include <cstdlib>
26#include <cstring>
27#include <initializer_list>
28#include <iterator>
29#include <limits>
30#include <utility>
31
32namespace llvm {
33
34/// SmallPtrSetImplBase - This is the common code shared among all the
35/// SmallPtrSet<>'s, which is almost everything. SmallPtrSet has two modes, one
36/// for small and one for large sets.
37///
38/// Small sets use an array of pointers allocated in the SmallPtrSet object,
39/// which is treated as a simple array of pointers. When a pointer is added to
40/// the set, the array is scanned to see if the element already exists, if not
41/// the element is 'pushed back' onto the array. If we run out of space in the
42/// array, we grow into the 'large set' case. SmallSet should be used when the
43/// sets are often small. In this case, no memory allocation is used, and only
44/// light-weight and cache-efficient scanning is used.
45///
46/// Large sets use a classic exponentially-probed hash table. Empty buckets are
47/// represented with an illegal pointer value (-1) to allow null pointers to be
48/// inserted. Tombstones are represented with another illegal pointer value
49/// (-2), to allow deletion. The hash table is resized when the table is 3/4 or
50/// more. When this happens, the table is doubled in size.
51///
54
55protected:
56 /// SmallArray - Points to a fixed size set of buckets, used in 'small mode'.
57 const void **SmallArray;
58 /// CurArray - This is the current set of buckets. If equal to SmallArray,
59 /// then the set is in 'small mode'.
60 const void **CurArray;
61 /// CurArraySize - The allocated size of CurArray, always a power of two.
62 unsigned CurArraySize;
63
64 /// Number of elements in CurArray that contain a value or are a tombstone.
65 /// If small, all these elements are at the beginning of CurArray and the rest
66 /// is uninitialized.
67 unsigned NumNonEmpty;
68 /// Number of tombstones in CurArray.
69 unsigned NumTombstones;
70
71 // Helpers to copy and move construct a SmallPtrSet.
72 SmallPtrSetImplBase(const void **SmallStorage,
73 const SmallPtrSetImplBase &that);
74 SmallPtrSetImplBase(const void **SmallStorage, unsigned SmallSize,
75 SmallPtrSetImplBase &&that);
76
77 explicit SmallPtrSetImplBase(const void **SmallStorage, unsigned SmallSize)
78 : SmallArray(SmallStorage), CurArray(SmallStorage),
79 CurArraySize(SmallSize), NumNonEmpty(0), NumTombstones(0) {
80 assert(SmallSize && (SmallSize & (SmallSize-1)) == 0 &&
81 "Initial size must be a power of two!");
82 }
83
85 if (!isSmall())
86 free(CurArray);
87 }
88
89public:
91
93
94 [[nodiscard]] bool empty() const { return size() == 0; }
96 size_type capacity() const { return CurArraySize; }
97
98 void clear() {
100 // If the capacity of the array is huge, and the # elements used is small,
101 // shrink the array.
102 if (!isSmall()) {
103 if (size() * 4 < CurArraySize && CurArraySize > 32)
104 return shrink_and_clear();
105 // Fill the array with empty markers.
106 memset(CurArray, -1, CurArraySize * sizeof(void *));
107 }
108
109 NumNonEmpty = 0;
110 NumTombstones = 0;
111 }
112
113 void reserve(size_type NumEntries) {
115 // Do nothing if we're given zero as a reservation size.
116 if (NumEntries == 0)
117 return;
118 // No need to expand if we're small and NumEntries will fit in the space.
119 if (isSmall() && NumEntries <= CurArraySize)
120 return;
121 // insert_imp_big will reallocate if stores is more than 75% full, on the
122 // /final/ insertion.
123 if (!isSmall() && ((NumEntries - 1) * 4) < (CurArraySize * 3))
124 return;
125 // We must Grow -- find the size where we'd be 75% full, then round up to
126 // the next power of two.
127 size_type NewSize = NumEntries + (NumEntries / 3);
128 NewSize = 1 << (Log2_32_Ceil(NewSize) + 1);
129 // Like insert_imp_big, always allocate at least 128 elements.
130 NewSize = std::max(128u, NewSize);
131 Grow(NewSize);
132 }
133
134protected:
135 static void *getTombstoneMarker() { return reinterpret_cast<void*>(-2); }
136
137 static void *getEmptyMarker() {
138 // Note that -1 is chosen to make clear() efficiently implementable with
139 // memset and because it's not a valid pointer value.
140 return reinterpret_cast<void*>(-1);
141 }
142
143 const void **EndPointer() const {
145 }
146
147 /// insert_imp - This returns true if the pointer was new to the set, false if
148 /// it was already in the set. This is hidden from the client so that the
149 /// derived class can check that the right type of pointer is passed in.
150 std::pair<const void *const *, bool> insert_imp(const void *Ptr) {
151 if (isSmall()) {
152 // Check to see if it is already in the set.
153 for (const void **APtr = SmallArray, **E = SmallArray + NumNonEmpty;
154 APtr != E; ++APtr) {
155 const void *Value = *APtr;
156 if (Value == Ptr)
157 return std::make_pair(APtr, false);
158 }
159
160 // Nope, there isn't. If we stay small, just 'pushback' now.
164 return std::make_pair(SmallArray + (NumNonEmpty - 1), true);
165 }
166 // Otherwise, hit the big set case, which will call grow.
167 }
168 return insert_imp_big(Ptr);
169 }
170
171 /// erase_imp - If the set contains the specified pointer, remove it and
172 /// return true, otherwise return false. This is hidden from the client so
173 /// that the derived class can check that the right type of pointer is passed
174 /// in.
175 bool erase_imp(const void * Ptr) {
176 if (isSmall()) {
177 for (const void **APtr = SmallArray, **E = SmallArray + NumNonEmpty;
178 APtr != E; ++APtr) {
179 if (*APtr == Ptr) {
180 *APtr = SmallArray[--NumNonEmpty];
182 return true;
183 }
184 }
185 return false;
186 }
187
188 auto *Bucket = doFind(Ptr);
189 if (!Bucket)
190 return false;
191
192 *const_cast<const void **>(Bucket) = getTombstoneMarker();
194 // Treat this consistently from an API perspective, even if we don't
195 // actually invalidate iterators here.
197 return true;
198 }
199
200 /// Returns the raw pointer needed to construct an iterator. If element not
201 /// found, this will be EndPointer. Otherwise, it will be a pointer to the
202 /// slot which stores Ptr;
203 const void *const * find_imp(const void * Ptr) const {
204 if (isSmall()) {
205 // Linear search for the item.
206 for (const void *const *APtr = SmallArray,
207 *const *E = SmallArray + NumNonEmpty; APtr != E; ++APtr)
208 if (*APtr == Ptr)
209 return APtr;
210 return EndPointer();
211 }
212
213 // Big set case.
214 if (auto *Bucket = doFind(Ptr))
215 return Bucket;
216 return EndPointer();
217 }
218
219 bool isSmall() const { return CurArray == SmallArray; }
220
221private:
222 std::pair<const void *const *, bool> insert_imp_big(const void *Ptr);
223
224 const void *const *doFind(const void *Ptr) const;
225 const void * const *FindBucketFor(const void *Ptr) const;
226 void shrink_and_clear();
227
228 /// Grow - Allocate a larger backing store for the buckets and move it over.
229 void Grow(unsigned NewSize);
230
231protected:
232 /// swap - Swaps the elements of two sets.
233 /// Note: This method assumes that both sets have the same small size.
234 void swap(SmallPtrSetImplBase &RHS);
235
236 void CopyFrom(const SmallPtrSetImplBase &RHS);
237 void MoveFrom(unsigned SmallSize, SmallPtrSetImplBase &&RHS);
238
239private:
240 /// Code shared by MoveFrom() and move constructor.
241 void MoveHelper(unsigned SmallSize, SmallPtrSetImplBase &&RHS);
242 /// Code shared by CopyFrom() and copy constructor.
243 void CopyHelper(const SmallPtrSetImplBase &RHS);
244};
245
246/// SmallPtrSetIteratorImpl - This is the common base class shared between all
247/// instances of SmallPtrSetIterator.
249protected:
250 const void *const *Bucket;
251 const void *const *End;
252
253public:
254 explicit SmallPtrSetIteratorImpl(const void *const *BP, const void*const *E)
255 : Bucket(BP), End(E) {
256 if (shouldReverseIterate()) {
258 return;
259 }
261 }
262
264 return Bucket == RHS.Bucket;
265 }
267 return Bucket != RHS.Bucket;
268 }
269
270protected:
271 /// AdvanceIfNotValid - If the current bucket isn't valid, advance to a bucket
272 /// that is. This is guaranteed to stop because the end() bucket is marked
273 /// valid.
275 assert(Bucket <= End);
276 while (Bucket != End &&
279 ++Bucket;
280 }
282 assert(Bucket >= End);
283 while (Bucket != End &&
286 --Bucket;
287 }
288 }
289};
290
291/// SmallPtrSetIterator - This implements a const_iterator for SmallPtrSet.
292template <typename PtrTy>
297
298public:
299 using value_type = PtrTy;
300 using reference = PtrTy;
301 using pointer = PtrTy;
302 using difference_type = std::ptrdiff_t;
303 using iterator_category = std::forward_iterator_tag;
304
305 explicit SmallPtrSetIterator(const void *const *BP, const void *const *E,
306 const DebugEpochBase &Epoch)
307 : SmallPtrSetIteratorImpl(BP, E), DebugEpochBase::HandleBase(&Epoch) {}
308
309 // Most methods are provided by the base class.
310
311 const PtrTy operator*() const {
312 assert(isHandleInSync() && "invalid iterator access!");
313 if (shouldReverseIterate()) {
314 assert(Bucket > End);
315 return PtrTraits::getFromVoidPointer(const_cast<void *>(Bucket[-1]));
316 }
317 assert(Bucket < End);
318 return PtrTraits::getFromVoidPointer(const_cast<void*>(*Bucket));
319 }
320
321 inline SmallPtrSetIterator& operator++() { // Preincrement
322 assert(isHandleInSync() && "invalid iterator access!");
323 if (shouldReverseIterate()) {
324 --Bucket;
325 RetreatIfNotValid();
326 return *this;
327 }
328 ++Bucket;
329 AdvanceIfNotValid();
330 return *this;
331 }
332
333 SmallPtrSetIterator operator++(int) { // Postincrement
334 SmallPtrSetIterator tmp = *this;
335 ++*this;
336 return tmp;
337 }
338};
339
340/// A templated base class for \c SmallPtrSet which provides the
341/// typesafe interface that is common across all small sizes.
342///
343/// This is particularly useful for passing around between interface boundaries
344/// to avoid encoding a particular small size in the interface boundary.
345template <typename PtrType>
347 using ConstPtrType = typename add_const_past_pointer<PtrType>::type;
350
351protected:
352 // Forward constructors to the base.
354
355public:
358 using key_type = ConstPtrType;
359 using value_type = PtrType;
360
362
363 /// Inserts Ptr if and only if there is no element in the container equal to
364 /// Ptr. The bool component of the returned pair is true if and only if the
365 /// insertion takes place, and the iterator component of the pair points to
366 /// the element equal to Ptr.
367 std::pair<iterator, bool> insert(PtrType Ptr) {
368 auto p = insert_imp(PtrTraits::getAsVoidPointer(Ptr));
369 return std::make_pair(makeIterator(p.first), p.second);
370 }
371
372 /// Insert the given pointer with an iterator hint that is ignored. This is
373 /// identical to calling insert(Ptr), but allows SmallPtrSet to be used by
374 /// std::insert_iterator and std::inserter().
376 return insert(Ptr).first;
377 }
378
379 /// Remove pointer from the set.
380 ///
381 /// Returns whether the pointer was in the set. Invalidates iterators if
382 /// true is returned. To remove elements while iterating over the set, use
383 /// remove_if() instead.
384 bool erase(PtrType Ptr) {
385 return erase_imp(PtrTraits::getAsVoidPointer(Ptr));
386 }
387
388 /// Remove elements that match the given predicate.
389 ///
390 /// This method is a safe replacement for the following pattern, which is not
391 /// valid, because the erase() calls would invalidate the iterator:
392 ///
393 /// for (PtrType *Ptr : Set)
394 /// if (Pred(P))
395 /// Set.erase(P);
396 ///
397 /// Returns whether anything was removed. It is safe to read the set inside
398 /// the predicate function. However, the predicate must not modify the set
399 /// itself, only indicate a removal by returning true.
400 template <typename UnaryPredicate>
401 bool remove_if(UnaryPredicate P) {
402 bool Removed = false;
403 if (isSmall()) {
404 const void **APtr = SmallArray, **E = SmallArray + NumNonEmpty;
405 while (APtr != E) {
406 PtrType Ptr = PtrTraits::getFromVoidPointer(const_cast<void *>(*APtr));
407 if (P(Ptr)) {
408 *APtr = *--E;
409 --NumNonEmpty;
411 Removed = true;
412 } else {
413 ++APtr;
414 }
415 }
416 return Removed;
417 }
418
419 for (const void **APtr = CurArray, **E = EndPointer(); APtr != E; ++APtr) {
420 const void *Value = *APtr;
422 continue;
423 PtrType Ptr = PtrTraits::getFromVoidPointer(const_cast<void *>(Value));
424 if (P(Ptr)) {
425 *APtr = getTombstoneMarker();
428 Removed = true;
429 }
430 }
431 return Removed;
432 }
433
434 /// count - Return 1 if the specified pointer is in the set, 0 otherwise.
435 size_type count(ConstPtrType Ptr) const {
436 return find_imp(ConstPtrTraits::getAsVoidPointer(Ptr)) != EndPointer();
437 }
438 iterator find(ConstPtrType Ptr) const {
439 return makeIterator(find_imp(ConstPtrTraits::getAsVoidPointer(Ptr)));
440 }
441 bool contains(ConstPtrType Ptr) const {
442 return find_imp(ConstPtrTraits::getAsVoidPointer(Ptr)) != EndPointer();
443 }
444
445 template <typename IterT>
446 void insert(IterT I, IterT E) {
447 for (; I != E; ++I)
448 insert(*I);
449 }
450
451 void insert(std::initializer_list<PtrType> IL) {
452 insert(IL.begin(), IL.end());
453 }
454
455 iterator begin() const {
457 return makeIterator(EndPointer() - 1);
458 return makeIterator(CurArray);
459 }
460 iterator end() const { return makeIterator(EndPointer()); }
461
462private:
463 /// Create an iterator that dereferences to same place as the given pointer.
464 iterator makeIterator(const void *const *P) const {
466 return iterator(P == EndPointer() ? CurArray : P + 1, CurArray, *this);
467 return iterator(P, EndPointer(), *this);
468 }
469};
470
471/// Equality comparison for SmallPtrSet.
472///
473/// Iterates over elements of LHS confirming that each value from LHS is also in
474/// RHS, and that no additional values are in RHS.
475template <typename PtrType>
478 if (LHS.size() != RHS.size())
479 return false;
480
481 for (const auto *KV : LHS)
482 if (!RHS.count(KV))
483 return false;
484
485 return true;
486}
487
488/// Inequality comparison for SmallPtrSet.
489///
490/// Equivalent to !(LHS == RHS).
491template <typename PtrType>
494 return !(LHS == RHS);
495}
496
497/// SmallPtrSet - This class implements a set which is optimized for holding
498/// SmallSize or less elements. This internally rounds up SmallSize to the next
499/// power of two if it is not already a power of two. See the comments above
500/// SmallPtrSetImplBase for details of the algorithm.
501template<class PtrType, unsigned SmallSize>
502class SmallPtrSet : public SmallPtrSetImpl<PtrType> {
503 // In small mode SmallPtrSet uses linear search for the elements, so it is
504 // not a good idea to choose this value too high. You may consider using a
505 // DenseSet<> instead if you expect many elements in the set.
506 static_assert(SmallSize <= 32, "SmallSize should be small");
507
509
510 // A constexpr version of llvm::bit_ceil.
511 // TODO: Replace this with std::bit_ceil once C++20 is available.
512 static constexpr size_t RoundUpToPowerOfTwo(size_t X) {
513 size_t C = 1;
514 size_t CMax = C << (std::numeric_limits<size_t>::digits - 1);
515 while (C < X && C < CMax)
516 C <<= 1;
517 return C;
518 }
519
520 // Make sure that SmallSize is a power of two, round up if not.
521 static constexpr size_t SmallSizePowTwo = RoundUpToPowerOfTwo(SmallSize);
522 /// SmallStorage - Fixed size storage used in 'small mode'.
523 const void *SmallStorage[SmallSizePowTwo];
524
525public:
526 SmallPtrSet() : BaseT(SmallStorage, SmallSizePowTwo) {}
527 SmallPtrSet(const SmallPtrSet &that) : BaseT(SmallStorage, that) {}
529 : BaseT(SmallStorage, SmallSizePowTwo, std::move(that)) {}
530
531 template<typename It>
532 SmallPtrSet(It I, It E) : BaseT(SmallStorage, SmallSizePowTwo) {
533 this->insert(I, E);
534 }
535
536 SmallPtrSet(std::initializer_list<PtrType> IL)
537 : BaseT(SmallStorage, SmallSizePowTwo) {
538 this->insert(IL.begin(), IL.end());
539 }
540
543 if (&RHS != this)
544 this->CopyFrom(RHS);
545 return *this;
546 }
547
550 if (&RHS != this)
551 this->MoveFrom(SmallSizePowTwo, std::move(RHS));
552 return *this;
553 }
554
556 operator=(std::initializer_list<PtrType> IL) {
557 this->clear();
558 this->insert(IL.begin(), IL.end());
559 return *this;
560 }
561
562 /// swap - Swaps the elements of two sets.
565 }
566};
567
568} // end namespace llvm
569
570namespace std {
571
572 /// Implement std::swap in terms of SmallPtrSet swap.
573 template<class T, unsigned N>
575 LHS.swap(RHS);
576 }
577
578} // end namespace std
579
580#endif // LLVM_ADT_SMALLPTRSET_H
static GCRegistry::Add< CoreCLRGC > E("coreclr", "CoreCLR-compatible GC")
bool End
Definition: ELF_riscv.cpp:480
This file defines the DebugEpochBase and DebugEpochBase::HandleBase classes.
#define LLVM_DEBUGEPOCHBASE_HANDLEBASE_EMPTYBASE
Definition: EpochTracker.h:85
static GCMetadataPrinterRegistry::Add< ErlangGCPrinter > X("erlang", "erlang-compatible garbage collector")
#define I(x, y, z)
Definition: MD5.cpp:58
#define P(N)
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
Value * RHS
Value * LHS
SmallPtrSetImplBase - This is the common code shared among all the SmallPtrSet<>'s,...
Definition: SmallPtrSet.h:52
size_type size() const
Definition: SmallPtrSet.h:95
const void *const * find_imp(const void *Ptr) const
Returns the raw pointer needed to construct an iterator.
Definition: SmallPtrSet.h:203
unsigned NumTombstones
Number of tombstones in CurArray.
Definition: SmallPtrSet.h:69
void MoveFrom(unsigned SmallSize, SmallPtrSetImplBase &&RHS)
SmallPtrSetImplBase(const void **SmallStorage, const SmallPtrSetImplBase &that)
SmallPtrSetImplBase(const void **SmallStorage, unsigned SmallSize)
Definition: SmallPtrSet.h:77
const void ** CurArray
CurArray - This is the current set of buckets.
Definition: SmallPtrSet.h:60
unsigned NumNonEmpty
Number of elements in CurArray that contain a value or are a tombstone.
Definition: SmallPtrSet.h:67
std::pair< const void *const *, bool > insert_imp(const void *Ptr)
insert_imp - This returns true if the pointer was new to the set, false if it was already in the set.
Definition: SmallPtrSet.h:150
SmallPtrSetImplBase & operator=(const SmallPtrSetImplBase &)=delete
const void ** SmallArray
SmallArray - Points to a fixed size set of buckets, used in 'small mode'.
Definition: SmallPtrSet.h:57
void CopyFrom(const SmallPtrSetImplBase &RHS)
unsigned CurArraySize
CurArraySize - The allocated size of CurArray, always a power of two.
Definition: SmallPtrSet.h:62
const void ** EndPointer() const
Definition: SmallPtrSet.h:143
bool erase_imp(const void *Ptr)
erase_imp - If the set contains the specified pointer, remove it and return true, otherwise return fa...
Definition: SmallPtrSet.h:175
static void * getEmptyMarker()
Definition: SmallPtrSet.h:137
void reserve(size_type NumEntries)
Definition: SmallPtrSet.h:113
static void * getTombstoneMarker()
Definition: SmallPtrSet.h:135
void swap(SmallPtrSetImplBase &RHS)
swap - Swaps the elements of two sets.
size_type capacity() const
Definition: SmallPtrSet.h:96
A templated base class for SmallPtrSet which provides the typesafe interface that is common across al...
Definition: SmallPtrSet.h:346
iterator insert(iterator, PtrType Ptr)
Insert the given pointer with an iterator hint that is ignored.
Definition: SmallPtrSet.h:375
bool erase(PtrType Ptr)
Remove pointer from the set.
Definition: SmallPtrSet.h:384
iterator find(ConstPtrType Ptr) const
Definition: SmallPtrSet.h:438
size_type count(ConstPtrType Ptr) const
count - Return 1 if the specified pointer is in the set, 0 otherwise.
Definition: SmallPtrSet.h:435
SmallPtrSetImpl(const SmallPtrSetImpl &)=delete
void insert(IterT I, IterT E)
Definition: SmallPtrSet.h:446
bool remove_if(UnaryPredicate P)
Remove elements that match the given predicate.
Definition: SmallPtrSet.h:401
iterator end() const
Definition: SmallPtrSet.h:460
ConstPtrType key_type
Definition: SmallPtrSet.h:358
std::pair< iterator, bool > insert(PtrType Ptr)
Inserts Ptr if and only if there is no element in the container equal to Ptr.
Definition: SmallPtrSet.h:367
SmallPtrSetIterator< PtrType > iterator
Definition: SmallPtrSet.h:356
iterator begin() const
Definition: SmallPtrSet.h:455
void insert(std::initializer_list< PtrType > IL)
Definition: SmallPtrSet.h:451
bool contains(ConstPtrType Ptr) const
Definition: SmallPtrSet.h:441
SmallPtrSetIteratorImpl - This is the common base class shared between all instances of SmallPtrSetIt...
Definition: SmallPtrSet.h:248
bool operator!=(const SmallPtrSetIteratorImpl &RHS) const
Definition: SmallPtrSet.h:266
SmallPtrSetIteratorImpl(const void *const *BP, const void *const *E)
Definition: SmallPtrSet.h:254
const void *const * End
Definition: SmallPtrSet.h:251
const void *const * Bucket
Definition: SmallPtrSet.h:250
bool operator==(const SmallPtrSetIteratorImpl &RHS) const
Definition: SmallPtrSet.h:263
void AdvanceIfNotValid()
AdvanceIfNotValid - If the current bucket isn't valid, advance to a bucket that is.
Definition: SmallPtrSet.h:274
SmallPtrSetIterator - This implements a const_iterator for SmallPtrSet.
Definition: SmallPtrSet.h:295
const PtrTy operator*() const
Definition: SmallPtrSet.h:311
std::ptrdiff_t difference_type
Definition: SmallPtrSet.h:302
SmallPtrSetIterator(const void *const *BP, const void *const *E, const DebugEpochBase &Epoch)
Definition: SmallPtrSet.h:305
SmallPtrSetIterator operator++(int)
Definition: SmallPtrSet.h:333
SmallPtrSetIterator & operator++()
Definition: SmallPtrSet.h:321
std::forward_iterator_tag iterator_category
Definition: SmallPtrSet.h:303
SmallPtrSet - This class implements a set which is optimized for holding SmallSize or less elements.
Definition: SmallPtrSet.h:502
SmallPtrSet(SmallPtrSet &&that)
Definition: SmallPtrSet.h:528
SmallPtrSet(It I, It E)
Definition: SmallPtrSet.h:532
SmallPtrSet< PtrType, SmallSize > & operator=(SmallPtrSet< PtrType, SmallSize > &&RHS)
Definition: SmallPtrSet.h:549
void swap(SmallPtrSet< PtrType, SmallSize > &RHS)
swap - Swaps the elements of two sets.
Definition: SmallPtrSet.h:563
SmallPtrSet(std::initializer_list< PtrType > IL)
Definition: SmallPtrSet.h:536
SmallPtrSet< PtrType, SmallSize > & operator=(const SmallPtrSet< PtrType, SmallSize > &RHS)
Definition: SmallPtrSet.h:542
SmallPtrSet(const SmallPtrSet &that)
Definition: SmallPtrSet.h:527
SmallPtrSet< PtrType, SmallSize > & operator=(std::initializer_list< PtrType > IL)
Definition: SmallPtrSet.h:556
LLVM Value Representation.
Definition: Value.h:74
@ C
The default llvm calling convention, compatible with C.
Definition: CallingConv.h:34
This is an optimization pass for GlobalISel generic memory operations.
Definition: AddressRanges.h:18
unsigned Log2_32_Ceil(uint32_t Value)
Return the ceil log base 2 of the specified value, 32 if the value is zero.
Definition: MathExtras.h:353
bool operator!=(uint64_t V1, const APInt &V2)
Definition: APInt.h:2052
bool operator==(const AddressRangeValuePair &LHS, const AddressRangeValuePair &RHS)
bool shouldReverseIterate()
OutputIt move(R &&Range, OutputIt Out)
Provide wrappers to std::move which take ranges instead of having to pass begin/end explicitly.
Definition: STLExtras.h:1856
Implement std::hash so that hash_code can be used in STL containers.
Definition: BitVector.h:858
void swap(llvm::BitVector &LHS, llvm::BitVector &RHS)
Implement std::swap in terms of BitVector swap.
Definition: BitVector.h:860
A traits type that is used to handle pointer types and things that are just wrappers for pointers as ...