22 uint32_t PDBStringTable::getByteSize()
const {
return Header->ByteSize; }
23 uint32_t PDBStringTable::getNameCount()
const {
return NameCount; }
24 uint32_t PDBStringTable::getHashVersion()
const {
return Header->HashVersion; }
32 return make_error<RawError>(raw_error_code::corrupt_file,
33 "Invalid hash table signature");
34 if (Header->HashVersion != 1 && Header->HashVersion != 2)
35 return make_error<RawError>(raw_error_code::corrupt_file,
36 "Unsupported hash version");
47 if (
auto EC = Strings.initialize(Stream)) {
49 make_error<RawError>(raw_error_code::corrupt_file,
50 "Invalid hash table byte length"));
58 PDBStringTable::getStringTable()
const {
67 if (
auto EC = Reader.
readArray(IDs, *HashCount)) {
69 make_error<RawError>(raw_error_code::corrupt_file,
70 "Could not read bucket array"));
89 if (
auto EC = readHeader(SectionReader))
92 std::tie(SectionReader, Reader) = Reader.
split(Header->ByteSize);
93 if (
auto EC = readStrings(SectionReader))
98 if (
auto EC = readHashTable(Reader))
101 std::tie(SectionReader, Reader) = Reader.
split(
sizeof(
uint32_t));
102 if (
auto EC = readEpilogue(SectionReader))
110 return Strings.getString(ID);
116 size_t Count = IDs.size();
118 for (
size_t I = 0;
I < Count; ++
I) {
127 return make_error<RawError>(raw_error_code::no_entry);
128 auto ExpectedStr = getStringForID(ID);
130 return ExpectedStr.takeError();
132 if (*ExpectedStr == Str)
135 return make_error<RawError>(raw_error_code::no_entry);
uint32_t hashStringV2(StringRef Str)
This class represents lattice values for constants.
Error readInteger(T &Dest)
Read an integer of the specified endianness into Dest and update the stream's offset.
Error readObject(const T *&Dest)
Get a pointer to an object of type T from the underlying stream, as if by memcpy, and store the resul...
Tagged union holding either a T or a Error.
std::pair< BinaryStreamReader, BinaryStreamReader > split(uint32_t Offset) const
uint32_t hashStringV1(StringRef Str)
static ErrorSuccess success()
Create a success value.
BinaryStreamRef is to BinaryStream what ArrayRef is to an Array.
Represents a read-only view of a CodeView string table.
Error joinErrors(Error E1, Error E2)
Concatenate errors.
Error readStreamRef(BinaryStreamRef &Ref)
Read the entire remainder of the underlying stream into Ref.
uint32_t bytesRemaining() const
const uint32_t PDBStringTableSignature
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
Lightweight error class with error context and mandatory checking.
Provides read only access to a subclass of BinaryStream.
StringRef - Represent a constant reference to a string, i.e.
static std::string getSignature(FunctionType *FTy)
Error readArray(ArrayRef< T > &Array, uint32_t NumElements)
Get a reference to a NumElements element array of objects of type T from the underlying stream as if ...