]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - contrib/llvm/include/llvm/DebugInfo/PDB/Native/TpiStream.h
Merge llvm, clang, lld, lldb, compiler-rt and libc++ r303291, and update
[FreeBSD/FreeBSD.git] / contrib / llvm / include / llvm / DebugInfo / PDB / Native / TpiStream.h
1 //===- TpiStream.cpp - PDB Type Info (TPI) Stream 2 Access ------*- 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_PDBTPISTREAM_H
11 #define LLVM_DEBUGINFO_PDB_RAW_PDBTPISTREAM_H
12
13 #include "llvm/DebugInfo/CodeView/TypeRecord.h"
14 #include "llvm/DebugInfo/PDB/Native/HashTable.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/raw_ostream.h"
20
21 #include "llvm/Support/Error.h"
22
23 namespace llvm {
24 namespace msf {
25 class MappedBlockStream;
26 }
27 namespace pdb {
28 class PDBFile;
29
30 class TpiStream {
31   friend class TpiStreamBuilder;
32
33 public:
34   TpiStream(const PDBFile &File,
35             std::unique_ptr<msf::MappedBlockStream> Stream);
36   ~TpiStream();
37   Error reload();
38
39   PdbRaw_TpiVer getTpiVersion() const;
40
41   uint32_t TypeIndexBegin() const;
42   uint32_t TypeIndexEnd() const;
43   uint32_t getNumTypeRecords() const;
44   uint16_t getTypeHashStreamIndex() const;
45   uint16_t getTypeHashStreamAuxIndex() const;
46
47   uint32_t getHashKeySize() const;
48   uint32_t getNumHashBuckets() const;
49   FixedStreamArray<support::ulittle32_t> getHashValues() const;
50   FixedStreamArray<codeview::TypeIndexOffset> getTypeIndexOffsets() const;
51   HashTable &getHashAdjusters();
52
53   codeview::CVTypeRange types(bool *HadError) const;
54   const codeview::CVTypeArray &typeArray() const { return TypeRecords; }
55
56   Error commit();
57
58 private:
59   const PDBFile &Pdb;
60   std::unique_ptr<msf::MappedBlockStream> Stream;
61
62   codeview::CVTypeArray TypeRecords;
63
64   std::unique_ptr<BinaryStream> HashStream;
65   FixedStreamArray<support::ulittle32_t> HashValues;
66   FixedStreamArray<codeview::TypeIndexOffset> TypeIndexOffsets;
67   HashTable HashAdjusters;
68
69   const TpiStreamHeader *Header;
70 };
71 }
72 }
73
74 #endif