75 static const std::pair<uint32_t, uint32_t> StringsToBuckets[] = {
116 {13453488, 26906975},
117 {20180232, 40360463},
118 {30270348, 60540695},
119 {45405522, 90811043},
120 {68108283, 136216565},
121 {102162424, 204324848},
122 {153243637, 306487273},
123 {229865455, 459730910},
124 {344798183, 689596366},
125 {517197275, 1034394550},
126 {775795913, 1551591826},
127 {1163693870, 2327387740}};
130 assert(Entry != std::end(StringsToBuckets));
131 return Entry->second;
134uint32_t PDBStringTableBuilder::calculateHashTableSize()
const {
145 Size += calculateHashTableSize();
152 this->Strings = Strings;
161 if (
auto EC =
Writer.writeObject(
H))
178 if (
auto EC =
Writer.writeInteger(BucketCount))
180 std::vector<ulittle32_t> Buckets(BucketCount);
182 for (
const auto &Pair : Strings) {
189 if (Buckets[
Slot] != 0)
215 if (
auto EC = writeHeader(SectionWriter))
218 std::tie(SectionWriter,
Writer) =
219 Writer.split(Strings.calculateSerializedSize());
220 if (
auto EC = writeStrings(SectionWriter))
223 std::tie(SectionWriter,
Writer) =
Writer.split(calculateHashTableSize());
224 if (
auto EC = writeHashTable(SectionWriter))
228 if (
auto EC = writeEpilogue(SectionWriter))
static uint32_t computeBucketCount(uint32_t NumStrings)
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory),...
Provides write only access to a subclass of WritableBinaryStream.
Lightweight error class with error context and mandatory checking.
static ErrorSuccess success()
Create a success value.
StringRef - Represent a constant reference to a string, i.e.
The TimeTraceScope is a helper class to call the begin and end functions of the time trace profiler.
Represents a read-write view of a CodeView string table.
StringRef getStringForId(uint32_t Id) const
uint32_t calculateSerializedSize() const override
uint32_t getIdForString(StringRef S) const
uint32_t insert(StringRef S)
Error commit(BinaryStreamWriter &Writer) const override
uint32_t insert(StringRef S)
uint32_t calculateSerializedSize() const
void setStrings(const codeview::DebugStringTableSubsection &Strings)
Error commit(BinaryStreamWriter &Writer) const
StringRef getStringForId(uint32_t Id) const
uint32_t getIdForString(StringRef S) const
uint32_t hashStringV1(StringRef Str)
const uint32_t PDBStringTableSignature
This is an optimization pass for GlobalISel generic memory operations.
auto lower_bound(R &&Range, T &&Value)
Provide wrappers to std::lower_bound which take ranges instead of having to pass begin/end explicitly...
Function object to check whether the first component of a container supported by std::get (like std::...
uint32_t hashLookupKey(StringRef S) const
StringRef storageKeyToLookupKey(uint32_t Offset) const
PDBStringTableBuilder * Table
StringTableHashTraits(PDBStringTableBuilder &Table)
uint32_t lookupKeyToStorageKey(StringRef S)
Adapter to write values to a stream in a particular byte order.