74 static const std::pair<uint32_t, uint32_t> StringsToBuckets[] = {
115 {13453488, 26906975},
116 {20180232, 40360463},
117 {30270348, 60540695},
118 {45405522, 90811043},
119 {68108283, 136216565},
120 {102162424, 204324848},
121 {153243637, 306487273},
122 {229865455, 459730910},
123 {344798183, 689596366},
124 {517197275, 1034394550},
125 {775795913, 1551591826},
126 {1163693870, 2327387740}};
129 assert(Entry != std::end(StringsToBuckets));
130 return Entry->second;
133uint32_t PDBStringTableBuilder::calculateHashTableSize()
const {
144 Size += calculateHashTableSize();
151 this->Strings = Strings;
160 if (
auto EC =
Writer.writeObject(
H))
177 if (
auto EC =
Writer.writeInteger(BucketCount))
179 std::vector<ulittle32_t> Buckets(BucketCount);
181 for (
const auto &Pair : Strings) {
188 if (Buckets[
Slot] != 0)
213 if (
auto EC = writeHeader(SectionWriter))
216 std::tie(SectionWriter,
Writer) =
217 Writer.split(Strings.calculateSerializedSize());
218 if (
auto EC = writeStrings(SectionWriter))
221 std::tie(SectionWriter,
Writer) =
Writer.split(calculateHashTableSize());
222 if (
auto EC = writeHashTable(SectionWriter))
226 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.
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.