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