LLVM  16.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/StringRef.h"
15 #include "llvm/Support/Endian.h"
16 #include "llvm/Support/Error.h"
17 #include <cstdint>
18 
19 namespace llvm {
20 class BinaryStreamReader;
21 
22 namespace pdb {
23 
24 struct PDBStringTableHeader;
25 
27 public:
29 
30  uint32_t getByteSize() const;
31  uint32_t getNameCount() const;
32  uint32_t getHashVersion() const;
33  uint32_t getSignature() const;
34 
37 
39 
41 
42 private:
43  Error readHeader(BinaryStreamReader &Reader);
44  Error readStrings(BinaryStreamReader &Reader);
45  Error readHashTable(BinaryStreamReader &Reader);
46  Error readEpilogue(BinaryStreamReader &Reader);
47 
48  const PDBStringTableHeader *Header = nullptr;
51  uint32_t NameCount = 0;
52 };
53 
54 } // end namespace pdb
55 } // end namespace llvm
56 
57 #endif // LLVM_DEBUGINFO_PDB_NATIVE_PDBSTRINGTABLE_H
llvm
This is an optimization pass for GlobalISel generic memory operations.
Definition: AddressRanges.h:18
llvm::pdb::PDBStringTable::getStringTable
const codeview::DebugStringTableSubsectionRef & getStringTable() const
Definition: PDBStringTable.cpp:57
StringRef.h
Error.h
llvm::Expected
Tagged union holding either a T or a Error.
Definition: APFloat.h:41
llvm::FixedStreamArray< support::ulittle32_t >
llvm::pdb::PDBStringTable::reload
Error reload(BinaryStreamReader &Reader)
Definition: PDBStringTable.cpp:83
llvm::pdb::PDBStringTable::name_ids
FixedStreamArray< support::ulittle32_t > name_ids() const
Definition: PDBStringTable.cpp:137
llvm::CallingConv::ID
unsigned ID
LLVM IR allows to use arbitrary numbers as calling convention identifiers.
Definition: CallingConv.h:24
llvm::BinaryStreamReader
Provides read only access to a subclass of BinaryStream.
Definition: BinaryStreamReader.h:29
llvm::pdb::PDBStringTable::getStringForID
Expected< StringRef > getStringForID(uint32_t ID) const
Definition: PDBStringTable.cpp:108
llvm::pdb::PDBStringTableHeader
The header preceding the /names stream.
Definition: RawTypes.h:312
BinaryStreamArray.h
llvm::pdb::PDBStringTable
Definition: PDBStringTable.h:26
llvm::pdb::PDBStringTable::getHashVersion
uint32_t getHashVersion() const
Definition: PDBStringTable.cpp:23
llvm::StringRef
StringRef - Represent a constant reference to a string, i.e.
Definition: StringRef.h:50
uint32_t
llvm::pdb::PDBStringTable::getNameCount
uint32_t getNameCount() const
Definition: PDBStringTable.cpp:22
llvm::Error
Lightweight error class with error context and mandatory checking.
Definition: Error.h:155
llvm::pdb::PDBStringTable::getIDForString
Expected< uint32_t > getIDForString(StringRef Str) const
Definition: PDBStringTable.cpp:112
llvm::pdb::PDBStringTable::getSignature
uint32_t getSignature() const
Definition: PDBStringTable.cpp:24
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:21
Endian.h