1 //===- PDBStringTable.h - PDB String Table -----------------------*- C++-*-===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 #ifndef LLVM_DEBUGINFO_PDB_RAW_PDBSTRINGTABLE_H
11 #define LLVM_DEBUGINFO_PDB_RAW_PDBSTRINGTABLE_H
13 #include "llvm/ADT/ArrayRef.h"
14 #include "llvm/ADT/StringRef.h"
15 #include "llvm/DebugInfo/CodeView/DebugStringTableSubsection.h"
16 #include "llvm/Support/BinaryStreamArray.h"
17 #include "llvm/Support/BinaryStreamRef.h"
18 #include "llvm/Support/Endian.h"
19 #include "llvm/Support/Error.h"
24 class BinaryStreamReader;
27 class MappedBlockStream;
32 struct PDBStringTableHeader;
34 class PDBStringTable {
36 Error reload(BinaryStreamReader &Reader);
38 uint32_t getByteSize() const;
39 uint32_t getNameCount() const;
40 uint32_t getHashVersion() const;
41 uint32_t getSignature() const;
43 Expected<StringRef> getStringForID(uint32_t ID) const;
44 Expected<uint32_t> getIDForString(StringRef Str) const;
46 FixedStreamArray<support::ulittle32_t> name_ids() const;
48 codeview::DebugStringTableSubsectionRef getStringTable() const;
51 Error readHeader(BinaryStreamReader &Reader);
52 Error readStrings(BinaryStreamReader &Reader);
53 Error readHashTable(BinaryStreamReader &Reader);
54 Error readEpilogue(BinaryStreamReader &Reader);
56 const PDBStringTableHeader *Header = nullptr;
57 codeview::DebugStringTableSubsectionRef Strings;
58 FixedStreamArray<support::ulittle32_t> IDs;
59 uint32_t ByteSize = 0;
60 uint32_t NameCount = 0;
63 } // end namespace pdb
64 } // end namespace llvm
66 #endif // LLVM_DEBUGINFO_PDB_RAW_STRINGTABLE_H