1 //===- PublicsStream.h - PDB Public Symbol Stream -------- ------*- C++ -*-===// 2 // 3 // The LLVM Compiler Infrastructure 4 // 5 // This file is distributed under the University of Illinois Open Source 6 // License. See LICENSE.TXT for details. 7 // 8 //===----------------------------------------------------------------------===// 9 10 #ifndef LLVM_DEBUGINFO_PDB_RAW_PUBLICSSTREAM_H 11 #define LLVM_DEBUGINFO_PDB_RAW_PUBLICSSTREAM_H 12 13 #include "llvm/DebugInfo/CodeView/StreamArray.h" 14 #include "llvm/DebugInfo/CodeView/SymbolRecord.h" 15 #include "llvm/DebugInfo/PDB/PDBTypes.h" 16 #include "llvm/DebugInfo/PDB/Raw/MappedBlockStream.h" 17 #include "llvm/DebugInfo/PDB/Raw/RawConstants.h" 18 #include "llvm/DebugInfo/PDB/Raw/RawTypes.h" 19 20 #include "llvm/Support/Error.h" 21 22 namespace llvm { 23 namespace pdb { 24 class DbiStream; 25 class PDBFile; 26 27 class PublicsStream { 28 struct GSIHashHeader; 29 struct HeaderInfo; 30 31 public: 32 PublicsStream(PDBFile &File, std::unique_ptr<MappedBlockStream> Stream); 33 ~PublicsStream(); 34 Error reload(); 35 36 uint32_t getSymHash() const; 37 uint32_t getAddrMap() const; getNumBuckets()38 uint32_t getNumBuckets() const { return NumBuckets; } 39 iterator_range<codeview::CVSymbolArray::Iterator> 40 getSymbols(bool *HadError) const; getHashBuckets()41 codeview::FixedStreamArray<support::ulittle32_t> getHashBuckets() const { 42 return HashBuckets; 43 } getAddressMap()44 codeview::FixedStreamArray<support::ulittle32_t> getAddressMap() const { 45 return AddressMap; 46 } getThunkMap()47 codeview::FixedStreamArray<support::ulittle32_t> getThunkMap() const { 48 return ThunkMap; 49 } getSectionOffsets()50 codeview::FixedStreamArray<SectionOffset> getSectionOffsets() const { 51 return SectionOffsets; 52 } 53 54 Error commit(); 55 56 private: 57 PDBFile &Pdb; 58 59 std::unique_ptr<MappedBlockStream> Stream; 60 uint32_t NumBuckets = 0; 61 ArrayRef<uint8_t> Bitmap; 62 codeview::FixedStreamArray<PSHashRecord> HashRecords; 63 codeview::FixedStreamArray<support::ulittle32_t> HashBuckets; 64 codeview::FixedStreamArray<support::ulittle32_t> AddressMap; 65 codeview::FixedStreamArray<support::ulittle32_t> ThunkMap; 66 codeview::FixedStreamArray<SectionOffset> SectionOffsets; 67 68 const HeaderInfo *Header; 69 const GSIHashHeader *HashHdr; 70 }; 71 } 72 } 73 74 #endif 75