LLVM  4.0.0
GSI.h
Go to the documentation of this file.
1 //===- GSI.h - Common Declarations for GlobalsStream and PublicsStream ----===//
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 // The data structures defined in this file are based on the reference
11 // implementation which is available at
12 // https://github.com/Microsoft/microsoft-pdb/blob/master/PDB/dbi/gsi.h
13 //
14 // When you are reading the reference source code, you'd find the
15 // information below useful.
16 //
17 // - ppdb1->m_fMinimalDbgInfo seems to be always true.
18 // - SMALLBUCKETS macro is defined.
19 //
20 // The reference doesn't compile, so I learned just by reading code.
21 // It's not guaranteed to be correct.
22 //
23 //===----------------------------------------------------------------------===//
24 
25 #ifndef LLVM_LIB_DEBUGINFO_PDB_RAW_GSI_H
26 #define LLVM_LIB_DEBUGINFO_PDB_RAW_GSI_H
27 
30 
31 #include "llvm/Support/Endian.h"
32 #include "llvm/Support/Error.h"
33 
34 namespace llvm {
35 
36 namespace msf {
37 class StreamReader;
38 }
39 
40 namespace pdb {
41 
42 /// From https://github.com/Microsoft/microsoft-pdb/blob/master/PDB/dbi/gsi.cpp
43 static const unsigned IPHR_HASH = 4096;
44 
45 /// Header of the hash tables found in the globals and publics sections.
46 /// Based on GSIHashHeader in
47 /// https://github.com/Microsoft/microsoft-pdb/blob/master/PDB/dbi/gsi.h
48 struct GSIHashHeader {
49  enum : unsigned {
50  HdrSignature = ~0U,
51  HdrVersion = 0xeffe0000 + 19990810,
52  };
57 };
58 
61  const GSIHashHeader *HashHdr, msf::StreamReader &Reader);
62 Error readGSIHashHeader(const GSIHashHeader *&HashHdr,
63  msf::StreamReader &Reader);
65  const GSIHashHeader *HashHdr,
66  msf::StreamReader &Reader);
67 }
68 }
69 
70 #endif
support::ulittle32_t VerSignature
Definition: GSI.h:53
static const unsigned IPHR_HASH
From https://github.com/Microsoft/microsoft-pdb/blob/master/PDB/dbi/gsi.cpp.
Definition: GSI.h:43
support::ulittle32_t VerHdr
Definition: GSI.h:54
Error readGSIHashBuckets(msf::FixedStreamArray< support::ulittle32_t > &HashBuckets, const GSIHashHeader *HashHdr, msf::StreamReader &Reader)
Definition: GSI.cpp:31
Header of the hash tables found in the globals and publics sections.
Definition: GSI.h:48
support::ulittle32_t NumBuckets
Definition: GSI.h:56
Error readGSIHashHeader(const GSIHashHeader *&HashHdr, msf::StreamReader &Reader)
Definition: GSI.cpp:59
Lightweight error class with error context and mandatory checking.
Error readGSIHashRecords(msf::FixedStreamArray< PSHashRecord > &HashRecords, const GSIHashHeader *HashHdr, msf::StreamReader &Reader)
Definition: GSI.cpp:73
support::ulittle32_t HrSize
Definition: GSI.h:55