LLVM  14.0.0git
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_NATIVE_PDBSTRINGTABLE_H
10 #define LLVM_DEBUGINFO_PDB_NATIVE_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 
21 namespace llvm {
22 class BinaryStreamReader;
23 
24 namespace msf {
25 class MappedBlockStream;
26 }
27 
28 namespace pdb {
29 
30 struct PDBStringTableHeader;
31 
33 public:
35 
36  uint32_t getByteSize() const;
37  uint32_t getNameCount() const;
38  uint32_t getHashVersion() const;
39  uint32_t getSignature() const;
40 
43 
45 
47 
48 private:
49  Error readHeader(BinaryStreamReader &Reader);
50  Error readStrings(BinaryStreamReader &Reader);
51  Error readHashTable(BinaryStreamReader &Reader);
52  Error readEpilogue(BinaryStreamReader &Reader);
53 
54  const PDBStringTableHeader *Header = nullptr;
57  uint32_t NameCount = 0;
58 };
59 
60 } // end namespace pdb
61 } // end namespace llvm
62 
63 #endif // LLVM_DEBUGINFO_PDB_NATIVE_PDBSTRINGTABLE_H
llvm
This file implements support for optimizing divisions by a constant.
Definition: AllocatorList.h:23
llvm::pdb::PDBStringTable::getStringTable
const codeview::DebugStringTableSubsectionRef & getStringTable() const
Definition: PDBStringTable.cpp:58
StringRef.h
Error.h
llvm::Expected
Tagged union holding either a T or a Error.
Definition: APFloat.h:42
llvm::FixedStreamArray< support::ulittle32_t >
llvm::pdb::PDBStringTable::reload
Error reload(BinaryStreamReader &Reader)
Definition: PDBStringTable.cpp:84
llvm::pdb::PDBStringTable::name_ids
FixedStreamArray< support::ulittle32_t > name_ids() const
Definition: PDBStringTable.cpp:138
llvm::BinaryStreamReader
Provides read only access to a subclass of BinaryStream.
Definition: BinaryStreamReader.h:31
llvm::pdb::PDBStringTable::getStringForID
Expected< StringRef > getStringForID(uint32_t ID) const
Definition: PDBStringTable.cpp:109
ArrayRef.h
llvm::pdb::PDBStringTableHeader
The header preceding the /names stream.
Definition: RawTypes.h:312
BinaryStreamArray.h
llvm::pdb::PDBStringTable
Definition: PDBStringTable.h:32
llvm::pdb::PDBStringTable::getHashVersion
uint32_t getHashVersion() const
Definition: PDBStringTable.cpp:24
llvm::StringRef
StringRef - Represent a constant reference to a string, i.e.
Definition: StringRef.h:58
BinaryStreamRef.h
uint32_t
llvm::pdb::PDBStringTable::getNameCount
uint32_t getNameCount() const
Definition: PDBStringTable.cpp:23
llvm::Error
Lightweight error class with error context and mandatory checking.
Definition: Error.h:157
llvm::pdb::PDBStringTable::getIDForString
Expected< uint32_t > getIDForString(StringRef Str) const
Definition: PDBStringTable.cpp:113
llvm::pdb::PDBStringTable::getSignature
uint32_t getSignature() const
Definition: PDBStringTable.cpp:25
DebugStringTableSubsection.h
llvm::codeview::DebugStringTableSubsectionRef
Represents a read-only view of a CodeView string table.
Definition: DebugStringTableSubsection.h:31
llvm::pdb::PDBStringTable::getByteSize
uint32_t getByteSize() const
Definition: PDBStringTable.cpp:22
Endian.h
llvm::Intrinsic::ID
unsigned ID
Definition: TargetTransformInfo.h:37