LLVM  8.0.1
PDBStringTable.h
Go to the documentation of this file.
1 //===- PDBStringTable.h - PDB String Table -----------------------*- C++-*-===//
2 //
3 // The LLVM Compiler Infrastructure
4 //
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9 
10 #ifndef LLVM_DEBUGINFO_PDB_RAW_PDBSTRINGTABLE_H
11 #define LLVM_DEBUGINFO_PDB_RAW_PDBSTRINGTABLE_H
12 
13 #include "llvm/ADT/ArrayRef.h"
14 #include "llvm/ADT/StringRef.h"
18 #include "llvm/Support/Endian.h"
19 #include "llvm/Support/Error.h"
20 #include <cstdint>
21 #include <vector>
22 
23 namespace llvm {
24 class BinaryStreamReader;
25 
26 namespace msf {
27 class MappedBlockStream;
28 }
29 
30 namespace pdb {
31 
32 struct PDBStringTableHeader;
33 
35 public:
36  Error reload(BinaryStreamReader &Reader);
37 
38  uint32_t getByteSize() const;
39  uint32_t getNameCount() const;
40  uint32_t getHashVersion() const;
41  uint32_t getSignature() const;
42 
43  Expected<StringRef> getStringForID(uint32_t ID) const;
44  Expected<uint32_t> getIDForString(StringRef Str) const;
45 
47 
48  const codeview::DebugStringTableSubsectionRef &getStringTable() const;
49 
50 private:
51  Error readHeader(BinaryStreamReader &Reader);
52  Error readStrings(BinaryStreamReader &Reader);
53  Error readHashTable(BinaryStreamReader &Reader);
54  Error readEpilogue(BinaryStreamReader &Reader);
55 
56  const PDBStringTableHeader *Header = nullptr;
59  uint32_t NameCount = 0;
60 };
61 
62 } // end namespace pdb
63 } // end namespace llvm
64 
65 #endif // LLVM_DEBUGINFO_PDB_RAW_STRINGTABLE_H
This class represents lattice values for constants.
Definition: AllocatorList.h:24
Tagged union holding either a T or a Error.
Definition: CachePruning.h:23
The header preceeding the /names stream.
Definition: RawTypes.h:313
Represents a read-only view of a CodeView string table.
Lightweight error class with error context and mandatory checking.
Definition: Error.h:158
Provides read only access to a subclass of BinaryStream.
StringRef - Represent a constant reference to a string, i.e.
Definition: StringRef.h:49
static std::string getSignature(FunctionType *FTy)