42 return Strings.insert(S);
46 return Strings.getIdForString(S);
50 return Strings.getStringForId(Id);
100 {45405522, 90811043},
101 {68108283, 136216565},
102 {102162424, 204324848},
103 {153243637, 306487273},
104 {229865455, 459730910},
105 {344798183, 689596366},
106 {517197275, 1034394550},
107 {775795913, 1551591826}};
112 return Entry->second;
115 uint32_t PDBStringTableBuilder::calculateHashTableSize()
const {
125 Size += Strings.calculateSerializedSize();
126 Size += calculateHashTableSize();
133 this->Strings = Strings;
141 H.
ByteSize = Strings.calculateSerializedSize();
149 if (
auto EC = Strings.commit(Writer))
161 std::vector<ulittle32_t> Buckets(BucketCount);
163 for (
auto &Pair : Strings) {
170 if (Buckets[Slot] != 0)
195 if (
auto EC = writeHeader(SectionWriter))
198 std::tie(SectionWriter, Writer) =
199 Writer.
split(Strings.calculateSerializedSize());
200 if (
auto EC = writeStrings(SectionWriter))
203 std::tie(SectionWriter, Writer) = Writer.
split(calculateHashTableSize());
204 if (
auto EC = writeHashTable(SectionWriter))
207 std::tie(SectionWriter, Writer) = Writer.
split(
sizeof(
uint32_t));
208 if (
auto EC = writeEpilogue(SectionWriter))
Error writeObject(const T &Obj)
Writes the object Obj to the underlying stream, as if by using memcpy.
uint32_t lookupKeyToStorageKey(StringRef S)
StringRef getStringForId(uint32_t Id) const
uint32_t getIdForString(StringRef S) const
This class represents lattice values for constants.
static std::map< uint32_t, uint32_t > StringsToBuckets
Error commit(BinaryStreamWriter &Writer) const
ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory)...
Error writeArray(ArrayRef< T > Array)
Writes an array of objects of type T to the underlying stream, as if by using memcpy.
uint32_t hashLookupKey(StringRef S) const
uint32_t calculateSerializedSize() const
void setStrings(const codeview::DebugStringTableSubsection &Strings)
static uint32_t computeBucketCount(uint32_t NumStrings)
uint32_t hashStringV1(StringRef Str)
uint32_t insert(StringRef S)
Provides write only access to a subclass of WritableBinaryStream.
Error writeInteger(T Value)
Write the integer Value to the underlying stream in the specified endianness.
uint32_t bytesRemaining() const
static ErrorSuccess success()
Create a success value.
Represents a read-write view of a CodeView string table.
std::pair< BinaryStreamWriter, BinaryStreamWriter > split(uint32_t Off) const
Splits the Writer into two Writers at a given offset.
PDBStringTableBuilder * Table
Adapter to write values to a stream in a particular byte order.
const uint32_t PDBStringTableSignature
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
StringRef storageKeyToLookupKey(uint32_t Offset) const
Lightweight error class with error context and mandatory checking.
StringRef - Represent a constant reference to a string, i.e.