24 void SmallPtrSetImplBase::shrink_and_clear() {
25 assert(!isSmall() &&
"Can't shrink a small set!");
39 std::pair<const void *const *, bool>
40 SmallPtrSetImplBase::insert_imp_big(
const void *
Ptr) {
51 const void **Bucket =
const_cast<const void**
>(FindBucketFor(Ptr));
53 return std::make_pair(Bucket,
false);
61 return std::make_pair(Bucket,
true);
64 const void *
const *SmallPtrSetImplBase::FindBucketFor(
const void *Ptr)
const {
67 unsigned ProbeAmt = 1;
69 const void *
const *Tombstone =
nullptr;
75 return Tombstone ? Tombstone : Array+Bucket;
84 Tombstone = Array+Bucket;
87 Bucket = (Bucket + ProbeAmt++) & (ArraySize-1);
93 void SmallPtrSetImplBase::Grow(
unsigned NewSize) {
96 bool WasSmall = isSmall();
99 CurArray = (
const void**)malloc(
sizeof(
void*) * NewSize);
102 memset(
CurArray, -1, NewSize*
sizeof(
void*));
105 for (
const void **BucketPtr = OldBuckets; BucketPtr != OldEnd; ++BucketPtr) {
107 const void *Elt = *BucketPtr;
109 *
const_cast<void**
>(FindBucketFor(Elt)) = const_cast<void*>(Elt);
123 if (that.isSmall()) {
139 MoveHelper(SmallSize, std::move(that));
143 assert(&RHS !=
this &&
"Self-copy should be handled by the caller.");
145 if (isSmall() && RHS.isSmall())
147 "Cannot assign sets with different small sizes");
159 const void **
T = (
const void**)realloc(
CurArray,
186 MoveHelper(SmallSize, std::move(RHS));
189 void SmallPtrSetImplBase::MoveHelper(
unsigned SmallSize,
191 assert(&RHS !=
this &&
"Self-move should be handled by the caller.");
215 if (
this == &RHS)
return;
218 if (!this->isSmall() && !RHS.isSmall()) {
230 if (!this->isSmall() && RHS.isSmall()) {
243 if (this->isSmall() && !RHS.isSmall()) {
256 assert(this->isSmall() && RHS.isSmall());
260 if (this->NumNonEmpty > MinNonEmpty) {
266 this->SmallArray + MinNonEmpty);
static void * getTombstoneMarker()
unsigned Log2_32_Ceil(uint32_t Value)
Return the ceil log base 2 of the specified value, 32 if the value is zero.
#define LLVM_UNLIKELY(EXPR)
#define LLVM_LIKELY(EXPR)
Maximum length of the test input libFuzzer tries to guess a good value based on the corpus and reports it always prefer smaller inputs during the corpus shuffle When libFuzzer itself reports a bug this exit code will be used If indicates the maximal total time in seconds to run the fuzzer minimizes the provided crash input Use with tries to cleanse the provided crash input to make it contain fewer original bytes Use with exact_artifact_path to specify the output Experimental Use value profile to guide fuzzing Number of jobs to run If min(jobs, NumberOfCpuCores()/2)\" is used.") FUZZER_FLAG_INT(reload
void MoveFrom(unsigned SmallSize, SmallPtrSetImplBase &&RHS)
unsigned NumNonEmpty
Number of elements in CurArray that contain a value or are a tombstone.
void swap(SmallPtrSetImplBase &RHS)
swap - Swaps the elements of two sets.
unsigned CurArraySize
CurArraySize - The allocated size of CurArray, always a power of two.
const void ** CurArray
CurArray - This is the current set of buckets.
static void * getEmptyMarker()
const void ** EndPointer() const
void CopyFrom(const SmallPtrSetImplBase &RHS)
const void ** SmallArray
SmallArray - Points to a fixed size set of buckets, used in 'small mode'.
SmallPtrSetImplBase(const void **SmallStorage, const SmallPtrSetImplBase &that)
void swap(llvm::BitVector &LHS, llvm::BitVector &RHS)
Implement std::swap in terms of BitVector swap.
SmallPtrSetImplBase - This is the common code shared among all the SmallPtrSet<>'s, which is almost everything.
constexpr char Size[]
Key for Kernel::Arg::Metadata::mSize.
unsigned NumTombstones
Number of tombstones in CurArray.
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())