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/StringTable.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;
49 Error readHeader(BinaryStreamReader &Reader);
50 Error readStrings(BinaryStreamReader &Reader);
51 Error readHashTable(BinaryStreamReader &Reader);
52 Error readEpilogue(BinaryStreamReader &Reader);
54 const PDBStringTableHeader *Header = nullptr;
55 codeview::StringTableRef Strings;
56 FixedStreamArray<support::ulittle32_t> IDs;
57 uint32_t ByteSize = 0;
58 uint32_t NameCount = 0;
61 } // end namespace pdb
62 } // end namespace llvm
64 #endif // LLVM_DEBUGINFO_PDB_RAW_STRINGTABLE_H