xref: /freebsd/contrib/llvm-project/llvm/include/llvm/DebugInfo/PDB/Native/PublicsStream.h (revision 700637cbb5e582861067a11aaca4d053546871d2)
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 
12 #include "llvm/DebugInfo/PDB/Native/GlobalsStream.h"
13 #include "llvm/Support/BinaryStreamArray.h"
14 #include "llvm/Support/Compiler.h"
15 #include "llvm/Support/Error.h"
16 
17 namespace llvm {
18 namespace msf {
19 class MappedBlockStream;
20 }
21 namespace pdb {
22 struct PublicsStreamHeader;
23 struct SectionOffset;
24 
25 class PublicsStream {
26 public:
27   LLVM_ABI PublicsStream(std::unique_ptr<msf::MappedBlockStream> Stream);
28   LLVM_ABI ~PublicsStream();
29   LLVM_ABI Error reload();
30 
31   LLVM_ABI uint32_t getSymHash() const;
32   LLVM_ABI uint16_t getThunkTableSection() const;
33   LLVM_ABI uint32_t getThunkTableOffset() const;
getPublicsTable()34   const GSIHashTable &getPublicsTable() const { return PublicsTable; }
getAddressMap()35   FixedStreamArray<support::ulittle32_t> getAddressMap() const {
36     return AddressMap;
37   }
getThunkMap()38   FixedStreamArray<support::ulittle32_t> getThunkMap() const {
39     return ThunkMap;
40   }
getSectionOffsets()41   FixedStreamArray<SectionOffset> getSectionOffsets() const {
42     return SectionOffsets;
43   }
44 
45 private:
46   std::unique_ptr<msf::MappedBlockStream> Stream;
47   GSIHashTable PublicsTable;
48   FixedStreamArray<support::ulittle32_t> AddressMap;
49   FixedStreamArray<support::ulittle32_t> ThunkMap;
50   FixedStreamArray<SectionOffset> SectionOffsets;
51 
52   const PublicsStreamHeader *Header;
53 };
54 }
55 }
56 
57 #endif
58