]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - contrib/llvm/include/llvm/DebugInfo/PDB/Native/TpiStream.h
Merge ^/head r319801 through r320041.
[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 codeview {
25 class LazyRandomTypeCollection;
26 }
27 namespace msf {
28 class MappedBlockStream;
29 }
30 namespace pdb {
31 class PDBFile;
32
33 class TpiStream {
34   friend class TpiStreamBuilder;
35
36 public:
37   TpiStream(PDBFile &File, std::unique_ptr<msf::MappedBlockStream> Stream);
38   ~TpiStream();
39   Error reload();
40
41   PdbRaw_TpiVer getTpiVersion() const;
42
43   uint32_t TypeIndexBegin() const;
44   uint32_t TypeIndexEnd() const;
45   uint32_t getNumTypeRecords() const;
46   uint16_t getTypeHashStreamIndex() const;
47   uint16_t getTypeHashStreamAuxIndex() const;
48
49   uint32_t getHashKeySize() const;
50   uint32_t getNumHashBuckets() const;
51   FixedStreamArray<support::ulittle32_t> getHashValues() const;
52   FixedStreamArray<codeview::TypeIndexOffset> getTypeIndexOffsets() const;
53   HashTable &getHashAdjusters();
54
55   codeview::CVTypeRange types(bool *HadError) const;
56   const codeview::CVTypeArray &typeArray() const { return TypeRecords; }
57
58   codeview::LazyRandomTypeCollection &typeCollection() { return *Types; }
59
60   Error commit();
61
62 private:
63   PDBFile &Pdb;
64   std::unique_ptr<msf::MappedBlockStream> Stream;
65
66   std::unique_ptr<codeview::LazyRandomTypeCollection> Types;
67
68   codeview::CVTypeArray TypeRecords;
69
70   std::unique_ptr<BinaryStream> HashStream;
71   FixedStreamArray<support::ulittle32_t> HashValues;
72   FixedStreamArray<codeview::TypeIndexOffset> TypeIndexOffsets;
73   HashTable HashAdjusters;
74
75   const TpiStreamHeader *Header;
76 };
77 }
78 }
79
80 #endif