16#ifndef LLVM_ADT_STRINGMAPENTRY_H
17#define LLVM_ADT_STRINGMAPENTRY_H
40 template <
typename AllocatorTy>
46template <
typename AllocatorTy>
50 size_t KeyLength =
Key.size();
54 size_t AllocSize = EntrySize + KeyLength + 1;
55 void *Allocation =
Allocator.Allocate(AllocSize, EntryAlign);
56 assert(Allocation &&
"Unhandled out-of-memory");
59 char *Buffer =
reinterpret_cast<char *
>(Allocation) + EntrySize;
61 ::memcpy(Buffer,
Key.data(), KeyLength);
62 Buffer[KeyLength] = 0;
71template <
typename ValueTy>
78 template <
typename... InitTy>
81 second(
std::forward<InitTy>(initVals)...) {}
103template <
typename ValueTy>
118 return reinterpret_cast<const char *
>(
this + 1);
125 template <
typename AllocatorTy,
typename... InitTy>
127 InitTy &&...initVals) {
146 allocator.Deallocate(
static_cast<void *
>(
this), AllocSize,
153template <std::
size_t Index,
typename ValueTy>
155 static_assert(Index < 2);
156 if constexpr (Index == 0)
162template <std::
size_t Index,
typename ValueTy>
164 static_assert(Index < 2);
165 if constexpr (Index == 0)
173template <
typename ValueTy>
174struct std::tuple_size<
llvm::StringMapEntry<ValueTy>>
175 : std::integral_constant<std::size_t, 2> {};
177template <std::
size_t Index,
typename ValueTy>
178struct std::tuple_element<Index,
llvm::StringMapEntry<ValueTy>>
179 : std::tuple_element<Index, std::pair<llvm::StringRef, ValueTy>> {};
assert(UImm &&(UImm !=~static_cast< T >(0)) &&"Invalid immediate!")
static GCRegistry::Add< CoreCLRGC > E("coreclr", "CoreCLR-compatible GC")
StringMapEntryBase - Shared base class of StringMapEntry instances.
size_t getKeyLength() const
static void * allocateWithKey(size_t EntrySize, size_t EntryAlign, StringRef Key, AllocatorTy &Allocator)
Helper to tail-allocate Key.
StringMapEntryBase(size_t keyLength)
StringMapEntryStorage(size_t keyLength, EmptyStringSetTag={})
EmptyStringSetTag getValue() const
StringMapEntryStorage(StringMapEntryStorage &entry)=delete
StringMapEntryStorage(size_t keyLength)
StringMapEntryStorage(StringMapEntryStorage &e)=delete
StringMapEntryStorage(size_t keyLength, InitTy &&...initVals)
const ValueTy & getValue() const
void setValue(const ValueTy &V)
StringMapEntry - This is used to represent one value that is inserted into a StringMap.
static StringMapEntry * create(StringRef key, AllocatorTy &allocator, InitTy &&...initVals)
Create a StringMapEntry for the specified key construct the value using InitiVals.
void Destroy(AllocatorTy &allocator)
Destroy - Destroy this StringMapEntry, releasing memory back to the specified allocator.
static StringMapEntry & GetStringMapEntryFromKeyData(const char *keyData)
GetStringMapEntryFromKeyData - Given key data that is known to be embedded into a StringMapEntry,...
const char * getKeyData() const
getKeyData - Return the start of the string data that is the key for this value.
StringRef - Represent a constant reference to a string, i.e.
constexpr size_t size() const
size - Get the string size.
This is an optimization pass for GlobalISel generic memory operations.
decltype(auto) get(const PointerIntPair< PointerTy, IntBits, IntType, PtrTraits, Info > &Pair)
LLVM_ATTRIBUTE_VISIBILITY_DEFAULT AnalysisKey InnerAnalysisManagerProxy< AnalysisManagerT, IRUnitT, ExtraArgTs... >::Key
Implement std::hash so that hash_code can be used in STL containers.
The "value type" of StringSet represented as an empty struct.