LLVM  6.0.0svn
SmallPtrSet.h
Go to the documentation of this file.
1 //===- llvm/ADT/SmallPtrSet.h - 'Normally small' pointer set ----*- C++ -*-===//
2 //
3 // The LLVM Compiler Infrastructure
4 //
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9 //
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 
18 #include "llvm/Support/Compiler.h"
22 #include <cassert>
23 #include <cstddef>
24 #include <cstdlib>
25 #include <cstring>
26 #include <initializer_list>
27 #include <iterator>
28 #include <utility>
29 
30 namespace llvm {
31 
32 /// SmallPtrSetImplBase - This is the common code shared among all the
33 /// SmallPtrSet<>'s, which is almost everything. SmallPtrSet has two modes, one
34 /// for small and one for large sets.
35 ///
36 /// Small sets use an array of pointers allocated in the SmallPtrSet object,
37 /// which is treated as a simple array of pointers. When a pointer is added to
38 /// the set, the array is scanned to see if the element already exists, if not
39 /// the element is 'pushed back' onto the array. If we run out of space in the
40 /// array, we grow into the 'large set' case. SmallSet should be used when the
41 /// sets are often small. In this case, no memory allocation is used, and only
42 /// light-weight and cache-efficient scanning is used.
43 ///
44 /// Large sets use a classic exponentially-probed hash table. Empty buckets are
45 /// represented with an illegal pointer value (-1) to allow null pointers to be
46 /// inserted. Tombstones are represented with another illegal pointer value
47 /// (-2), to allow deletion. The hash table is resized when the table is 3/4 or
48 /// more. When this happens, the table is doubled in size.
49 ///
52 
53 protected:
54  /// SmallArray - Points to a fixed size set of buckets, used in 'small mode'.
55  const void **SmallArray;
56  /// CurArray - This is the current set of buckets. If equal to SmallArray,
57  /// then the set is in 'small mode'.
58  const void **CurArray;
59  /// CurArraySize - The allocated size of CurArray, always a power of two.
60  unsigned CurArraySize;
61 
62  /// Number of elements in CurArray that contain a value or are a tombstone.
63  /// If small, all these elements are at the beginning of CurArray and the rest
64  /// is uninitialized.
65  unsigned NumNonEmpty;
66  /// Number of tombstones in CurArray.
67  unsigned NumTombstones;
68 
69  // Helpers to copy and move construct a SmallPtrSet.
70  SmallPtrSetImplBase(const void **SmallStorage,
71  const SmallPtrSetImplBase &that);
72  SmallPtrSetImplBase(const void **SmallStorage, unsigned SmallSize,
73  SmallPtrSetImplBase &&that);
74 
75  explicit SmallPtrSetImplBase(const void **SmallStorage, unsigned SmallSize)
76  : SmallArray(SmallStorage), CurArray(SmallStorage),
77  CurArraySize(SmallSize), NumNonEmpty(0), NumTombstones(0) {
78  assert(SmallSize && (SmallSize & (SmallSize-1)) == 0 &&
79  "Initial size must be a power of two!");
80  }
81 
83  if (!isSmall())
84  free(CurArray);
85  }
86 
87 public:
89 
91 
92  LLVM_NODISCARD bool empty() const { return size() == 0; }
93  size_type size() const { return NumNonEmpty - NumTombstones; }
94 
95  void clear() {
96  // If the capacity of the array is huge, and the # elements used is small,
97  // shrink the array.
98  if (!isSmall()) {
99  if (size() * 4 < CurArraySize && CurArraySize > 32)
100  return shrink_and_clear();
101  // Fill the array with empty markers.
102  memset(CurArray, -1, CurArraySize * sizeof(void *));
103  }
104 
105  NumNonEmpty = 0;
106  NumTombstones = 0;
107  }
108 
109 protected:
110  static void *getTombstoneMarker() { return reinterpret_cast<void*>(-2); }
111 
112  static void *getEmptyMarker() {
113  // Note that -1 is chosen to make clear() efficiently implementable with
114  // memset and because it's not a valid pointer value.
115  return reinterpret_cast<void*>(-1);
116  }
117 
118  const void **EndPointer() const {
119  return isSmall() ? CurArray + NumNonEmpty : CurArray + CurArraySize;
120  }
121 
122  /// insert_imp - This returns true if the pointer was new to the set, false if
123  /// it was already in the set. This is hidden from the client so that the
124  /// derived class can check that the right type of pointer is passed in.
125  std::pair<const void *const *, bool> insert_imp(const void *Ptr) {
126  if (isSmall()) {
127  // Check to see if it is already in the set.
128  const void **LastTombstone = nullptr;
129  for (const void **APtr = SmallArray, **E = SmallArray + NumNonEmpty;
130  APtr != E; ++APtr) {
131  const void *Value = *APtr;
132  if (Value == Ptr)
133  return std::make_pair(APtr, false);
134  if (Value == getTombstoneMarker())
135  LastTombstone = APtr;
136  }
137 
138  // Did we find any tombstone marker?
139  if (LastTombstone != nullptr) {
140  *LastTombstone = Ptr;
141  --NumTombstones;
142  return std::make_pair(LastTombstone, true);
143  }
144 
145  // Nope, there isn't. If we stay small, just 'pushback' now.
146  if (NumNonEmpty < CurArraySize) {
147  SmallArray[NumNonEmpty++] = Ptr;
148  return std::make_pair(SmallArray + (NumNonEmpty - 1), true);
149  }
150  // Otherwise, hit the big set case, which will call grow.
151  }
152  return insert_imp_big(Ptr);
153  }
154 
155  /// erase_imp - If the set contains the specified pointer, remove it and
156  /// return true, otherwise return false. This is hidden from the client so
157  /// that the derived class can check that the right type of pointer is passed
158  /// in.
159  bool erase_imp(const void * Ptr) {
160  const void *const *P = find_imp(Ptr);
161  if (P == EndPointer())
162  return false;
163 
164  const void **Loc = const_cast<const void **>(P);
165  assert(*Loc == Ptr && "broken find!");
166  *Loc = getTombstoneMarker();
167  NumTombstones++;
168  return true;
169  }
170 
171  /// Returns the raw pointer needed to construct an iterator. If element not
172  /// found, this will be EndPointer. Otherwise, it will be a pointer to the
173  /// slot which stores Ptr;
174  const void *const * find_imp(const void * Ptr) const {
175  if (isSmall()) {
176  // Linear search for the item.
177  for (const void *const *APtr = SmallArray,
178  *const *E = SmallArray + NumNonEmpty; APtr != E; ++APtr)
179  if (*APtr == Ptr)
180  return APtr;
181  return EndPointer();
182  }
183 
184  // Big set case.
185  auto *Bucket = FindBucketFor(Ptr);
186  if (*Bucket == Ptr)
187  return Bucket;
188  return EndPointer();
189  }
190 
191 private:
192  bool isSmall() const { return CurArray == SmallArray; }
193 
194  std::pair<const void *const *, bool> insert_imp_big(const void *Ptr);
195 
196  const void * const *FindBucketFor(const void *Ptr) const;
197  void shrink_and_clear();
198 
199  /// Grow - Allocate a larger backing store for the buckets and move it over.
200  void Grow(unsigned NewSize);
201 
202 protected:
203  /// swap - Swaps the elements of two sets.
204  /// Note: This method assumes that both sets have the same small size.
205  void swap(SmallPtrSetImplBase &RHS);
206 
207  void CopyFrom(const SmallPtrSetImplBase &RHS);
208  void MoveFrom(unsigned SmallSize, SmallPtrSetImplBase &&RHS);
209 
210 private:
211  /// Code shared by MoveFrom() and move constructor.
212  void MoveHelper(unsigned SmallSize, SmallPtrSetImplBase &&RHS);
213  /// Code shared by CopyFrom() and copy constructor.
214  void CopyHelper(const SmallPtrSetImplBase &RHS);
215 };
216 
217 /// SmallPtrSetIteratorImpl - This is the common base class shared between all
218 /// instances of SmallPtrSetIterator.
220 protected:
221  const void *const *Bucket;
222  const void *const *End;
223 
224 public:
225  explicit SmallPtrSetIteratorImpl(const void *const *BP, const void*const *E)
226  : Bucket(BP), End(E) {
227 #if LLVM_ENABLE_ABI_BREAKING_CHECKS
229  RetreatIfNotValid();
230  return;
231  }
232 #endif
233  AdvanceIfNotValid();
234  }
235 
236  bool operator==(const SmallPtrSetIteratorImpl &RHS) const {
237  return Bucket == RHS.Bucket;
238  }
239  bool operator!=(const SmallPtrSetIteratorImpl &RHS) const {
240  return Bucket != RHS.Bucket;
241  }
242 
243 protected:
244  /// AdvanceIfNotValid - If the current bucket isn't valid, advance to a bucket
245  /// that is. This is guaranteed to stop because the end() bucket is marked
246  /// valid.
248  assert(Bucket <= End);
249  while (Bucket != End &&
250  (*Bucket == SmallPtrSetImplBase::getEmptyMarker() ||
252  ++Bucket;
253  }
254 #if LLVM_ENABLE_ABI_BREAKING_CHECKS
255  void RetreatIfNotValid() {
256  assert(Bucket >= End);
257  while (Bucket != End &&
258  (Bucket[-1] == SmallPtrSetImplBase::getEmptyMarker() ||
259  Bucket[-1] == SmallPtrSetImplBase::getTombstoneMarker())) {
260  --Bucket;
261  }
262  }
263 #endif
264 };
265 
266 /// SmallPtrSetIterator - This implements a const_iterator for SmallPtrSet.
267 template<typename PtrTy>
270 
271 public:
272  using value_type = PtrTy;
273  using reference = PtrTy;
274  using pointer = PtrTy;
275  using difference_type = std::ptrdiff_t;
276  using iterator_category = std::forward_iterator_tag;
277 
278  explicit SmallPtrSetIterator(const void *const *BP, const void *const *E)
279  : SmallPtrSetIteratorImpl(BP, E) {}
280 
281  // Most methods provided by baseclass.
282 
283  const PtrTy operator*() const {
284 #if LLVM_ENABLE_ABI_BREAKING_CHECKS
286  assert(Bucket > End);
287  return PtrTraits::getFromVoidPointer(const_cast<void *>(Bucket[-1]));
288  }
289 #endif
290  assert(Bucket < End);
291  return PtrTraits::getFromVoidPointer(const_cast<void*>(*Bucket));
292  }
293 
294  inline SmallPtrSetIterator& operator++() { // Preincrement
295 #if LLVM_ENABLE_ABI_BREAKING_CHECKS
297  --Bucket;
298  RetreatIfNotValid();
299  return *this;
300  }
301 #endif
302  ++Bucket;
303  AdvanceIfNotValid();
304  return *this;
305  }
306 
307  SmallPtrSetIterator operator++(int) { // Postincrement
308  SmallPtrSetIterator tmp = *this;
309  ++*this;
310  return tmp;
311  }
312 };
313 
314 /// RoundUpToPowerOfTwo - This is a helper template that rounds N up to the next
315 /// power of two (which means N itself if N is already a power of two).
316 template<unsigned N>
318 
319 /// RoundUpToPowerOfTwoH - If N is not a power of two, increase it. This is a
320 /// helper template used to implement RoundUpToPowerOfTwo.
321 template<unsigned N, bool isPowerTwo>
323  enum { Val = N };
324 };
325 template<unsigned N>
327  enum {
328  // We could just use NextVal = N+1, but this converges faster. N|(N-1) sets
329  // the right-most zero bits to one all at once, e.g. 0b0011000 -> 0b0011111.
330  Val = RoundUpToPowerOfTwo<(N|(N-1)) + 1>::Val
331  };
332 };
333 
334 template<unsigned N>
335 struct RoundUpToPowerOfTwo {
336  enum { Val = RoundUpToPowerOfTwoH<N, (N&(N-1)) == 0>::Val };
337 };
338 
339 /// \brief A templated base class for \c SmallPtrSet which provides the
340 /// typesafe interface that is common across all small sizes.
341 ///
342 /// This is particularly useful for passing around between interface boundaries
343 /// to avoid encoding a particular small size in the interface boundary.
344 template <typename PtrType>
346  using ConstPtrType = typename add_const_past_pointer<PtrType>::type;
349 
350 protected:
351  // Constructors that forward to the base.
352  SmallPtrSetImpl(const void **SmallStorage, const SmallPtrSetImpl &that)
353  : SmallPtrSetImplBase(SmallStorage, that) {}
354  SmallPtrSetImpl(const void **SmallStorage, unsigned SmallSize,
355  SmallPtrSetImpl &&that)
356  : SmallPtrSetImplBase(SmallStorage, SmallSize, std::move(that)) {}
357  explicit SmallPtrSetImpl(const void **SmallStorage, unsigned SmallSize)
358  : SmallPtrSetImplBase(SmallStorage, SmallSize) {}
359 
360 public:
363  using key_type = ConstPtrType;
364  using value_type = PtrType;
365 
366  SmallPtrSetImpl(const SmallPtrSetImpl &) = delete;
367 
368  /// Inserts Ptr if and only if there is no element in the container equal to
369  /// Ptr. The bool component of the returned pair is true if and only if the
370  /// insertion takes place, and the iterator component of the pair points to
371  /// the element equal to Ptr.
372  std::pair<iterator, bool> insert(PtrType Ptr) {
373  auto p = insert_imp(PtrTraits::getAsVoidPointer(Ptr));
374  return std::make_pair(makeIterator(p.first), p.second);
375  }
376 
377  /// erase - If the set contains the specified pointer, remove it and return
378  /// true, otherwise return false.
379  bool erase(PtrType Ptr) {
380  return erase_imp(PtrTraits::getAsVoidPointer(Ptr));
381  }
382  /// count - Return 1 if the specified pointer is in the set, 0 otherwise.
383  size_type count(ConstPtrType Ptr) const { return find(Ptr) != end() ? 1 : 0; }
384  iterator find(ConstPtrType Ptr) const {
385  return makeIterator(find_imp(ConstPtrTraits::getAsVoidPointer(Ptr)));
386  }
387 
388  template <typename IterT>
389  void insert(IterT I, IterT E) {
390  for (; I != E; ++I)
391  insert(*I);
392  }
393 
394  void insert(std::initializer_list<PtrType> IL) {
395  insert(IL.begin(), IL.end());
396  }
397 
398  iterator begin() const {
399 #if LLVM_ENABLE_ABI_BREAKING_CHECKS
401  return makeIterator(EndPointer() - 1);
402 #endif
403  return makeIterator(CurArray);
404  }
405  iterator end() const { return makeIterator(EndPointer()); }
406 
407 private:
408  /// Create an iterator that dereferences to same place as the given pointer.
409  iterator makeIterator(const void *const *P) const {
410 #if LLVM_ENABLE_ABI_BREAKING_CHECKS
412  return iterator(P == EndPointer() ? CurArray : P + 1, CurArray);
413 #endif
414  return iterator(P, EndPointer());
415  }
416 };
417 
418 /// SmallPtrSet - This class implements a set which is optimized for holding
419 /// SmallSize or less elements. This internally rounds up SmallSize to the next
420 /// power of two if it is not already a power of two. See the comments above
421 /// SmallPtrSetImplBase for details of the algorithm.
422 template<class PtrType, unsigned SmallSize>
423 class SmallPtrSet : public SmallPtrSetImpl<PtrType> {
424  // In small mode SmallPtrSet uses linear search for the elements, so it is
425  // not a good idea to choose this value too high. You may consider using a
426  // DenseSet<> instead if you expect many elements in the set.
427  static_assert(SmallSize <= 32, "SmallSize should be small");
428 
430 
431  // Make sure that SmallSize is a power of two, round up if not.
432  enum { SmallSizePowTwo = RoundUpToPowerOfTwo<SmallSize>::Val };
433  /// SmallStorage - Fixed size storage used in 'small mode'.
434  const void *SmallStorage[SmallSizePowTwo];
435 
436 public:
437  SmallPtrSet() : BaseT(SmallStorage, SmallSizePowTwo) {}
438  SmallPtrSet(const SmallPtrSet &that) : BaseT(SmallStorage, that) {}
440  : BaseT(SmallStorage, SmallSizePowTwo, std::move(that)) {}
441 
442  template<typename It>
443  SmallPtrSet(It I, It E) : BaseT(SmallStorage, SmallSizePowTwo) {
444  this->insert(I, E);
445  }
446 
447  SmallPtrSet(std::initializer_list<PtrType> IL)
448  : BaseT(SmallStorage, SmallSizePowTwo) {
449  this->insert(IL.begin(), IL.end());
450  }
451 
454  if (&RHS != this)
455  this->CopyFrom(RHS);
456  return *this;
457  }
458 
461  if (&RHS != this)
462  this->MoveFrom(SmallSizePowTwo, std::move(RHS));
463  return *this;
464  }
465 
467  operator=(std::initializer_list<PtrType> IL) {
468  this->clear();
469  this->insert(IL.begin(), IL.end());
470  return *this;
471  }
472 
473  /// swap - Swaps the elements of two sets.
476  }
477 };
478 
479 } // end namespace llvm
480 
481 namespace std {
482 
483  /// Implement std::swap in terms of SmallPtrSet swap.
484  template<class T, unsigned N>
486  LHS.swap(RHS);
487  }
488 
489 } // end namespace std
490 
491 #endif // LLVM_ADT_SMALLPTRSET_H
static void * getTombstoneMarker()
Definition: SmallPtrSet.h:110
SmallPtrSetImpl(const void **SmallStorage, unsigned SmallSize, SmallPtrSetImpl &&that)
Definition: SmallPtrSet.h:354
const_iterator end(StringRef path)
Get end iterator over path.
Definition: Path.cpp:243
SmallPtrSet(const SmallPtrSet &that)
Definition: SmallPtrSet.h:438
Compute iterated dominance frontiers using a linear time algorithm.
Definition: AllocatorList.h:24
bool operator==(const SmallPtrSetIteratorImpl &RHS) const
Definition: SmallPtrSet.h:236
SmallPtrSet(It I, It E)
Definition: SmallPtrSet.h:443
SmallPtrSetImpl(const void **SmallStorage, const SmallPtrSetImpl &that)
Definition: SmallPtrSet.h:352
bool operator!=(const SmallPtrSetIteratorImpl &RHS) const
Definition: SmallPtrSet.h:239
void MoveFrom(unsigned SmallSize, SmallPtrSetImplBase &&RHS)
unsigned NumNonEmpty
Number of elements in CurArray that contain a value or are a tombstone.
Definition: SmallPtrSet.h:65
A traits type that is used to handle pointer types and things that are just wrappers for pointers as ...
A templated base class for SmallPtrSet which provides the typesafe interface that is common across al...
Definition: SmallPtrSet.h:345
SmallPtrSetIterator & operator++()
Definition: SmallPtrSet.h:294
SmallPtrSetIteratorImpl - This is the common base class shared between all instances of SmallPtrSetIt...
Definition: SmallPtrSet.h:219
void swap(SmallPtrSetImplBase &RHS)
swap - Swaps the elements of two sets.
const PtrTy operator*() const
Definition: SmallPtrSet.h:283
Definition: BitVector.h:920
SmallPtrSet(std::initializer_list< PtrType > IL)
Definition: SmallPtrSet.h:447
iterator find(ConstPtrType Ptr) const
Definition: SmallPtrSet.h:384
const void *const * find_imp(const void *Ptr) const
Returns the raw pointer needed to construct an iterator.
Definition: SmallPtrSet.h:174
SmallPtrSet(SmallPtrSet &&that)
Definition: SmallPtrSet.h:439
unsigned CurArraySize
CurArraySize - The allocated size of CurArray, always a power of two.
Definition: SmallPtrSet.h:60
SmallPtrSetIterator(const void *const *BP, const void *const *E)
Definition: SmallPtrSet.h:278
const void ** CurArray
CurArray - This is the current set of buckets.
Definition: SmallPtrSet.h:58
RoundUpToPowerOfTwo - This is a helper template that rounds N up to the next power of two (which mean...
Definition: SmallPtrSet.h:317
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:159
SmallPtrSet< PtrType, SmallSize > & operator=(const SmallPtrSet< PtrType, SmallSize > &RHS)
Definition: SmallPtrSet.h:453
static void * getEmptyMarker()
Definition: SmallPtrSet.h:112
void AdvanceIfNotValid()
AdvanceIfNotValid - If the current bucket isn&#39;t valid, advance to a bucket that is.
Definition: SmallPtrSet.h:247
const void ** EndPointer() const
Definition: SmallPtrSet.h:118
void CopyFrom(const SmallPtrSetImplBase &RHS)
#define P(N)
void insert(IterT I, IterT E)
Definition: SmallPtrSet.h:389
SmallPtrSet< PtrType, SmallSize > & operator=(SmallPtrSet< PtrType, SmallSize > &&RHS)
Definition: SmallPtrSet.h:460
std::ptrdiff_t difference_type
Definition: SmallPtrSet.h:275
LLVM_NODISCARD bool empty() const
Definition: SmallPtrSet.h:92
SmallPtrSetIterator operator++(int)
Definition: SmallPtrSet.h:307
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:372
SmallPtrSetImpl(const void **SmallStorage, unsigned SmallSize)
Definition: SmallPtrSet.h:357
static const unsigned End
const void *const * Bucket
Definition: SmallPtrSet.h:221
size_type count(ConstPtrType Ptr) const
count - Return 1 if the specified pointer is in the set, 0 otherwise.
Definition: SmallPtrSet.h:383
std::forward_iterator_tag iterator_category
Definition: SmallPtrSet.h:276
const void *const * End
Definition: SmallPtrSet.h:222
SmallPtrSetIterator - This implements a const_iterator for SmallPtrSet.
Definition: SmallPtrSet.h:268
size_type size() const
Definition: SmallPtrSet.h:93
SmallPtrSet - This class implements a set which is optimized for holding SmallSize or less elements...
Definition: SmallPtrSet.h:423
#define E
Definition: LargeTest.cpp:27
auto find(R &&Range, const T &Val) -> decltype(std::begin(Range))
Provide wrappers to std::find which take ranges instead of having to pass begin/end explicitly...
Definition: STLExtras.h:839
bool erase(PtrType Ptr)
erase - If the set contains the specified pointer, remove it and return true, otherwise return false...
Definition: SmallPtrSet.h:379
const void ** SmallArray
SmallArray - Points to a fixed size set of buckets, used in &#39;small mode&#39;.
Definition: SmallPtrSet.h:55
SmallPtrSetImplBase(const void **SmallStorage, unsigned SmallSize)
Definition: SmallPtrSet.h:75
const size_t N
SmallPtrSetImplBase(const void **SmallStorage, const SmallPtrSetImplBase &that)
RoundUpToPowerOfTwoH - If N is not a power of two, increase it.
Definition: SmallPtrSet.h:322
SmallPtrSetImplBase - This is the common code shared among all the SmallPtrSet<>&#39;s, which is almost everything.
Definition: SmallPtrSet.h:50
iterator begin() const
Definition: SmallPtrSet.h:398
unsigned NumTombstones
Number of tombstones in CurArray.
Definition: SmallPtrSet.h:67
This class represents an analyzed expression in the program.
SmallPtrSet< PtrType, SmallSize > & operator=(std::initializer_list< PtrType > IL)
Definition: SmallPtrSet.h:467
#define I(x, y, z)
Definition: MD5.cpp:58
iterator end() const
Definition: SmallPtrSet.h:405
#define LLVM_NODISCARD
LLVM_NODISCARD - Warn if a type or return value is discarded.
Definition: Compiler.h:126
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
LLVM Value Representation.
Definition: Value.h:73
SmallPtrSetIteratorImpl(const void *const *BP, const void *const *E)
Definition: SmallPtrSet.h:225
int * Ptr
SmallPtrSetImplBase & operator=(const SmallPtrSetImplBase &)=delete
void insert(std::initializer_list< PtrType > IL)
Definition: SmallPtrSet.h:394
void swap(SmallPtrSet< PtrType, SmallSize > &RHS)
swap - Swaps the elements of two sets.
Definition: SmallPtrSet.h:474
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:125