1 //===- PDBStringTable.h - PDB String Table -----------------------*- C++-*-===//
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7 //===----------------------------------------------------------------------===//
9 #ifndef LLVM_DEBUGINFO_PDB_RAW_PDBSTRINGTABLE_H
10 #define LLVM_DEBUGINFO_PDB_RAW_PDBSTRINGTABLE_H
12 #include "llvm/ADT/ArrayRef.h"
13 #include "llvm/ADT/StringRef.h"
14 #include "llvm/DebugInfo/CodeView/DebugStringTableSubsection.h"
15 #include "llvm/Support/BinaryStreamArray.h"
16 #include "llvm/Support/BinaryStreamRef.h"
17 #include "llvm/Support/Endian.h"
18 #include "llvm/Support/Error.h"
23 class BinaryStreamReader
;
26 class MappedBlockStream
;
31 struct PDBStringTableHeader
;
33 class PDBStringTable
{
35 Error
reload(BinaryStreamReader
&Reader
);
37 uint32_t getByteSize() const;
38 uint32_t getNameCount() const;
39 uint32_t getHashVersion() const;
40 uint32_t getSignature() const;
42 Expected
<StringRef
> getStringForID(uint32_t ID
) const;
43 Expected
<uint32_t> getIDForString(StringRef Str
) const;
45 FixedStreamArray
<support::ulittle32_t
> name_ids() const;
47 const codeview::DebugStringTableSubsectionRef
&getStringTable() const;
50 Error
readHeader(BinaryStreamReader
&Reader
);
51 Error
readStrings(BinaryStreamReader
&Reader
);
52 Error
readHashTable(BinaryStreamReader
&Reader
);
53 Error
readEpilogue(BinaryStreamReader
&Reader
);
55 const PDBStringTableHeader
*Header
= nullptr;
56 codeview::DebugStringTableSubsectionRef Strings
;
57 FixedStreamArray
<support::ulittle32_t
> IDs
;
58 uint32_t NameCount
= 0;
61 } // end namespace pdb
62 } // end namespace llvm
64 #endif // LLVM_DEBUGINFO_PDB_RAW_STRINGTABLE_H