15 #ifndef LLVM_ADT_SMALLPTRSET_H
16 #define LLVM_ADT_SMALLPTRSET_H
19 #include "llvm/Support/DataTypes.h"
28 class SmallPtrSetIteratorImpl;
67 assert(SmallSize && (SmallSize & (SmallSize-1)) == 0 &&
68 "Initial size must be a power of two!");
81 return shrink_and_clear();
94 return reinterpret_cast<void*
>(-1);
119 return *FindBucketFor(Ptr) == Ptr;
125 const void *
const *FindBucketFor(
const void *Ptr)
const;
126 void shrink_and_clear();
129 void Grow(
unsigned NewSize);
173 template<
typename PtrTy>
191 return PtrTraits::getFromVoidPointer(const_cast<void*>(*
Bucket));
212 template<
unsigned N,
bool isPowerTwo>
226 struct RoundUpToPowerOfTwo {
235 template<
class PtrType,
unsigned SmallSize>
240 const void *SmallStorage[SmallSizePowTwo];
246 template<
typename It>
254 return insert_imp(PtrTraits::getAsVoidPointer(Ptr));
260 return erase_imp(PtrTraits::getAsVoidPointer(Ptr));
265 return count_imp(PtrTraits::getAsVoidPointer(Ptr));
268 template <
typename IterT>
301 template<
class T,
unsigned N>
const void ** SmallArray
SmallArray - Points to a fixed size set of buckets, used in 'small mode'.
#define LLVM_ATTRIBUTE_UNUSED_RESULT
SmallPtrSet(const SmallPtrSet &that)
std::ptrdiff_t difference_type
SmallPtrSetIterator< PtrType > const_iterator
SmallPtrSetIterator & operator++()
SmallPtrSetIterator(const void *const *BP, const void *const *E)
SmallPtrSetImpl(const void **SmallStorage, const SmallPtrSetImpl &that)
bool operator!=(const SmallPtrSetIteratorImpl &RHS) const
static void * getEmptyMarker()
bool count(PtrType Ptr) const
count - Return true if the specified pointer is in the set.
bool insert_imp(const void *Ptr)
const PtrTy operator*() const
SmallPtrSetIterator operator++(int)
void CopyFrom(const SmallPtrSetImpl &RHS)
bool erase_imp(const void *Ptr)
const void *const * Bucket
bool LLVM_ATTRIBUTE_UNUSED_RESULT empty() const
bool operator==(const SmallPtrSetIteratorImpl &RHS) const
SmallPtrSetIterator - This implements a const_iterator for SmallPtrSet.
SmallPtrSetIterator< PtrType > iterator
#define LLVM_DELETED_FUNCTION
void swap(llvm::BitVector &LHS, llvm::BitVector &RHS)
Implement std::swap in terms of BitVector swap.
void swap(SmallPtrSetImpl &RHS)
SmallPtrSetImpl(const void **SmallStorage, unsigned SmallSize)
void insert(IterT I, IterT E)
const SmallPtrSet< PtrType, SmallSize > & operator=(const SmallPtrSet< PtrType, SmallSize > &RHS)
SmallPtrSetIteratorImpl(const void *const *BP, const void *const *E)
unsigned CurArraySize
CurArraySize - The allocated size of CurArray, always a power of two.
void swap(SmallPtrSet< PtrType, SmallSize > &RHS)
swap - Swaps the elements of two sets.
static void * getTombstoneMarker()
bool count_imp(const void *Ptr) const
std::forward_iterator_tag iterator_category