23 uint32_t PDBStringTable::getByteSize()
const {
return Header->ByteSize; }
24 uint32_t PDBStringTable::getNameCount()
const {
return NameCount; }
25 uint32_t PDBStringTable::getHashVersion()
const {
return Header->HashVersion; }
33 return make_error<RawError>(raw_error_code::corrupt_file,
34 "Invalid hash table signature");
35 if (Header->HashVersion != 1 && Header->HashVersion != 2)
36 return make_error<RawError>(raw_error_code::corrupt_file,
37 "Unsupported hash version");
48 if (
auto EC = Strings.initialize(Stream)) {
50 make_error<RawError>(raw_error_code::corrupt_file,
51 "Invalid hash table byte length"));
59 PDBStringTable::getStringTable()
const {
68 if (
auto EC = Reader.
readArray(IDs, *HashCount)) {
70 make_error<RawError>(raw_error_code::corrupt_file,
71 "Could not read bucket array"));
90 if (
auto EC = readHeader(SectionReader))
93 std::tie(SectionReader, Reader) = Reader.
split(Header->ByteSize);
94 if (
auto EC = readStrings(SectionReader))
99 if (
auto EC = readHashTable(Reader))
102 std::tie(SectionReader, Reader) = Reader.
split(
sizeof(
uint32_t));
103 if (
auto EC = readEpilogue(SectionReader))
111 return Strings.getString(ID);
117 size_t Count = IDs.size();
119 for (
size_t I = 0;
I < Count; ++
I) {
128 return make_error<RawError>(raw_error_code::no_entry);
129 auto ExpectedStr = getStringForID(ID);
131 return ExpectedStr.takeError();
133 if (*ExpectedStr == Str)
136 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 ...