LLVM 22.0.0git
PublicsStream.h
Go to the documentation of this file.
1//===- PublicsStream.h - PDB Public Symbol Stream -------- ------*- 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_PUBLICSSTREAM_H
10#define LLVM_DEBUGINFO_PDB_NATIVE_PUBLICSSTREAM_H
11
15#include "llvm/Support/Error.h"
16
17namespace llvm {
18namespace msf {
20}
21namespace codeview {
22class PublicSym32;
23}
24namespace pdb {
26struct SectionOffset;
27class SymbolStream;
28
30public:
31 LLVM_ABI PublicsStream(std::unique_ptr<msf::MappedBlockStream> Stream);
34
38 const GSIHashTable &getPublicsTable() const { return PublicsTable; }
40 return AddressMap;
41 }
43 return ThunkMap;
44 }
46 return SectionOffsets;
47 }
48
49 /// Find a public symbol by a segment and offset.
50 ///
51 /// In case there is more than one symbol (for example due to ICF), the first
52 /// one is returned.
53 ///
54 /// \return If a symbol was found, the symbol at the provided address is
55 /// returned as well as the index of this symbol in the address map. If
56 /// the binary was linked with ICF, there might be more symbols with the
57 /// same address after the returned one. If no symbol is found,
58 /// `std::nullopt` is returned.
59 LLVM_ABI std::optional<std::pair<codeview::PublicSym32, size_t>>
61 uint32_t Offset) const;
62
63private:
64 std::unique_ptr<msf::MappedBlockStream> Stream;
65 GSIHashTable PublicsTable;
69
70 const PublicsStreamHeader *Header;
71};
72}
73}
74
75#endif
Lightweight arrays that are backed by an arbitrary BinaryStream.
#define LLVM_ABI
Definition Compiler.h:213
Lightweight error class with error context and mandatory checking.
Definition Error.h:159
FixedStreamArray is similar to VarStreamArray, except with each record having a fixed-length.
MappedBlockStream represents data stored in an MSF file into chunks of a particular size (called the ...
A readonly view of a hash table used in the globals and publics streams.
FixedStreamArray< support::ulittle32_t > getThunkMap() const
LLVM_ABI uint32_t getSymHash() const
FixedStreamArray< support::ulittle32_t > getAddressMap() const
LLVM_ABI uint32_t getThunkTableOffset() const
const GSIHashTable & getPublicsTable() const
LLVM_ABI PublicsStream(std::unique_ptr< msf::MappedBlockStream > Stream)
LLVM_ABI std::optional< std::pair< codeview::PublicSym32, size_t > > findByAddress(const SymbolStream &Symbols, uint16_t Segment, uint32_t Offset) const
Find a public symbol by a segment and offset.
FixedStreamArray< SectionOffset > getSectionOffsets() const
LLVM_ABI uint16_t getThunkTableSection() const
This is an optimization pass for GlobalISel generic memory operations.