36 : RecordStorage(Storage) {
37 SeenRecords.reserve(4096);
84 HashedRecords.clear();
97 assert(Record.
size() < UINT32_MAX &&
"Record too big");
98 assert(Record.
size() % 4 == 0 &&
"Record is not aligned to 4 bytes!");
101 auto Result = HashedRecords.try_emplace(WeakHash,
nextTypeIndex());
105 Result.first->first.RecordData = RecordData;
106 SeenRecords.push_back(RecordData);
110 TypeIndex ActualTI = Result.first->second;
124 assert(!Fragments.empty());
125 for (
auto C : Fragments)
~MergingTypeTableBuilder()
This class represents lattice values for constants.
A locally hashed type represents a straightforward hash code of a serialized record.
TypeLeafKind
Duplicate copy of the above enum, but using the official CV names.
Optional< TypeIndex > getNext(TypeIndex Prev) override
TypeIndex insertRecord(ContinuationRecordBuilder &Builder)
This file defines the MallocAllocator and BumpPtrAllocator interfaces.
MergingTypeTableBuilder(BumpPtrAllocator &Storage)
CVType getType(TypeIndex Index) override
StringRef getTypeName(TypeIndex Index) override
ArrayRef< T > makeArrayRef(const T &OneElt)
Construct an ArrayRef from a single element.
static const uint32_t FirstNonSimpleIndex
ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory)...
hash_code hash_value(const APFloat &Arg)
See friend declarations above.
uint32_t toArrayIndex() const
static TypeIndex fromArrayIndex(uint32_t Index)
The instances of the Type class are immutable: once they are created, they are never changed...
Allocate memory in an ever growing pool, as if by bump-pointer.
size_t size() const
size - Get the array size.
LLVM_ATTRIBUTE_RETURNS_NONNULL LLVM_ATTRIBUTE_RETURNS_NOALIAS void * Allocate(size_t Size, size_t Alignment)
Allocate space at the specified alignment.
bool contains(TypeIndex Index) override
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
uint32_t capacity() override
static ArrayRef< uint8_t > stabilize(BumpPtrAllocator &Alloc, ArrayRef< uint8_t > Data)
An opaque object representing a hash code.
std::vector< CVType > end(TypeIndex Index)
ArrayRef< uint8_t > RecordData
Optional< TypeIndex > getFirst() override
TypeIndex insertRecordBytes(ArrayRef< uint8_t > &Record)
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
TypeIndex insertRecordAs(hash_code Hash, ArrayRef< uint8_t > &Record)
StringRef - Represent a constant reference to a string, i.e.
TypeIndex nextTypeIndex() const
ArrayRef< ArrayRef< uint8_t > > records() const