]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - contrib/llvm/include/llvm/DebugInfo/PDB/Native/PublicsStream.h
Merge llvm, clang, lld, lldb, compiler-rt and libc++ r301441, and update
[FreeBSD/FreeBSD.git] / contrib / llvm / include / llvm / DebugInfo / PDB / Native / PublicsStream.h
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/SymbolRecord.h"
14 #include "llvm/DebugInfo/MSF/MappedBlockStream.h"
15 #include "llvm/DebugInfo/PDB/Native/RawConstants.h"
16 #include "llvm/DebugInfo/PDB/Native/RawTypes.h"
17 #include "llvm/DebugInfo/PDB/PDBTypes.h"
18 #include "llvm/Support/BinaryStreamArray.h"
19 #include "llvm/Support/Error.h"
20
21 namespace llvm {
22 namespace pdb {
23 class DbiStream;
24 struct GSIHashHeader;
25 class PDBFile;
26
27 class PublicsStream {
28   struct HeaderInfo;
29
30 public:
31   PublicsStream(PDBFile &File, std::unique_ptr<msf::MappedBlockStream> Stream);
32   ~PublicsStream();
33   Error reload();
34
35   uint32_t getSymHash() const;
36   uint32_t getAddrMap() const;
37   uint32_t getNumBuckets() const { return NumBuckets; }
38   iterator_range<codeview::CVSymbolArray::Iterator>
39   getSymbols(bool *HadError) const;
40   FixedStreamArray<support::ulittle32_t> getHashBuckets() const {
41     return HashBuckets;
42   }
43   FixedStreamArray<support::ulittle32_t> getAddressMap() const {
44     return AddressMap;
45   }
46   FixedStreamArray<support::ulittle32_t> getThunkMap() const {
47     return ThunkMap;
48   }
49   FixedStreamArray<SectionOffset> getSectionOffsets() const {
50     return SectionOffsets;
51   }
52
53   Error commit();
54
55 private:
56   PDBFile &Pdb;
57
58   std::unique_ptr<msf::MappedBlockStream> Stream;
59   uint32_t NumBuckets = 0;
60   ArrayRef<uint8_t> Bitmap;
61   FixedStreamArray<PSHashRecord> HashRecords;
62   FixedStreamArray<support::ulittle32_t> HashBuckets;
63   FixedStreamArray<support::ulittle32_t> AddressMap;
64   FixedStreamArray<support::ulittle32_t> ThunkMap;
65   FixedStreamArray<SectionOffset> SectionOffsets;
66
67   const HeaderInfo *Header;
68   const GSIHashHeader *HashHdr;
69 };
70 }
71 }
72
73 #endif