20std::optional<AllocTokenMode>
38 assert(MaxTokens &&
"Must provide non-zero max tokens");
52 const uint64_t HalfTokens = MaxTokens / 2;
assert(UImm &&(UImm !=~static_cast< T >(0)) &&"Invalid immediate!")
This file implements the StringSwitch template, which mimics a switch() statement whose cases are str...
static uint64_t getStableHash(const AllocTokenMetadata &Metadata, uint64_t MaxTokens)
StringRef - Represent a constant reference to a string, i.e.
A switch()-like statement whose cases are string literals.
StringSwitch & Case(StringLiteral S, T Value)
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
This is an optimization pass for GlobalISel generic memory operations.
LLVM_ABI std::optional< uint64_t > getAllocToken(AllocTokenMode Mode, const AllocTokenMetadata &Metadata, uint64_t MaxTokens)
Calculates stable allocation token ID.
LLVM_ABI uint64_t getStableSipHash(StringRef Str)
Compute a stable 64-bit hash of the given string.
AllocTokenMode
Modes for generating allocation token IDs.
@ TypeHash
Token ID based on allocated type hash.
@ Random
Simple mode that returns a statically-assigned random token ID.
@ Increment
Incrementally increasing token ID.
@ TypeHashPointerSplit
Token ID based on allocated type hash, where the top half ID-space is reserved for types that contain...
LLVM_ABI std::optional< AllocTokenMode > getAllocTokenModeFromString(StringRef Name)
Returns the AllocTokenMode from its canonical string name; if an invalid name was provided returns nu...