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