xref: /freebsd/contrib/llvm-project/llvm/include/llvm/DebugInfo/PDB/Native/PublicsStream.h (revision 81ad626541db97eb356e2c1d4a20eb2a26a766ab)
10b57cec5SDimitry Andric //===- PublicsStream.h - PDB Public Symbol Stream -------- ------*- C++ -*-===//
20b57cec5SDimitry Andric //
30b57cec5SDimitry Andric // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
40b57cec5SDimitry Andric // See https://llvm.org/LICENSE.txt for license information.
50b57cec5SDimitry Andric // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
60b57cec5SDimitry Andric //
70b57cec5SDimitry Andric //===----------------------------------------------------------------------===//
80b57cec5SDimitry Andric 
9fe6060f1SDimitry Andric #ifndef LLVM_DEBUGINFO_PDB_NATIVE_PUBLICSSTREAM_H
10fe6060f1SDimitry Andric #define LLVM_DEBUGINFO_PDB_NATIVE_PUBLICSSTREAM_H
110b57cec5SDimitry Andric 
120b57cec5SDimitry Andric #include "llvm/DebugInfo/PDB/Native/GlobalsStream.h"
130b57cec5SDimitry Andric #include "llvm/Support/BinaryStreamArray.h"
140b57cec5SDimitry Andric #include "llvm/Support/Error.h"
150b57cec5SDimitry Andric 
160b57cec5SDimitry Andric namespace llvm {
17*81ad6265SDimitry Andric namespace msf {
18*81ad6265SDimitry Andric class MappedBlockStream;
19*81ad6265SDimitry Andric }
200b57cec5SDimitry Andric namespace pdb {
21*81ad6265SDimitry Andric struct PublicsStreamHeader;
22*81ad6265SDimitry Andric struct SectionOffset;
230b57cec5SDimitry Andric 
240b57cec5SDimitry Andric class PublicsStream {
250b57cec5SDimitry Andric public:
260b57cec5SDimitry Andric   PublicsStream(std::unique_ptr<msf::MappedBlockStream> Stream);
270b57cec5SDimitry Andric   ~PublicsStream();
280b57cec5SDimitry Andric   Error reload();
290b57cec5SDimitry Andric 
300b57cec5SDimitry Andric   uint32_t getSymHash() const;
310b57cec5SDimitry Andric   uint16_t getThunkTableSection() const;
320b57cec5SDimitry Andric   uint32_t getThunkTableOffset() const;
getPublicsTable()330b57cec5SDimitry Andric   const GSIHashTable &getPublicsTable() const { return PublicsTable; }
getAddressMap()340b57cec5SDimitry Andric   FixedStreamArray<support::ulittle32_t> getAddressMap() const {
350b57cec5SDimitry Andric     return AddressMap;
360b57cec5SDimitry Andric   }
getThunkMap()370b57cec5SDimitry Andric   FixedStreamArray<support::ulittle32_t> getThunkMap() const {
380b57cec5SDimitry Andric     return ThunkMap;
390b57cec5SDimitry Andric   }
getSectionOffsets()400b57cec5SDimitry Andric   FixedStreamArray<SectionOffset> getSectionOffsets() const {
410b57cec5SDimitry Andric     return SectionOffsets;
420b57cec5SDimitry Andric   }
430b57cec5SDimitry Andric 
440b57cec5SDimitry Andric private:
450b57cec5SDimitry Andric   std::unique_ptr<msf::MappedBlockStream> Stream;
460b57cec5SDimitry Andric   GSIHashTable PublicsTable;
470b57cec5SDimitry Andric   FixedStreamArray<support::ulittle32_t> AddressMap;
480b57cec5SDimitry Andric   FixedStreamArray<support::ulittle32_t> ThunkMap;
490b57cec5SDimitry Andric   FixedStreamArray<SectionOffset> SectionOffsets;
500b57cec5SDimitry Andric 
510b57cec5SDimitry Andric   const PublicsStreamHeader *Header;
520b57cec5SDimitry Andric };
530b57cec5SDimitry Andric }
540b57cec5SDimitry Andric }
550b57cec5SDimitry Andric 
560b57cec5SDimitry Andric #endif
57