LLVM  5.0.0
TpiStream.h
Go to the documentation of this file.
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 
21 
22 #include "llvm/Support/Error.h"
23 
24 namespace llvm {
25 namespace codeview {
26 class LazyRandomTypeCollection;
27 }
28 namespace msf {
29 class MappedBlockStream;
30 }
31 namespace pdb {
32 class PDBFile;
33 
34 class TpiStream {
35  friend class TpiStreamBuilder;
36 
37 public:
38  TpiStream(PDBFile &File, std::unique_ptr<msf::MappedBlockStream> Stream);
39  ~TpiStream();
40  Error reload();
41 
43 
44  uint32_t TypeIndexBegin() const;
45  uint32_t TypeIndexEnd() const;
47  uint16_t getTypeHashStreamIndex() const;
48  uint16_t getTypeHashStreamAuxIndex() const;
49 
50  uint32_t getHashKeySize() const;
55 
56  codeview::CVTypeRange types(bool *HadError) const;
57  const codeview::CVTypeArray &typeArray() const { return TypeRecords; }
58 
60 
62 
63  Error commit();
64 
65 private:
66  PDBFile &Pdb;
67  std::unique_ptr<msf::MappedBlockStream> Stream;
68 
69  std::unique_ptr<codeview::LazyRandomTypeCollection> Types;
70 
71  BinarySubstreamRef TypeRecordsSubstream;
72 
73  codeview::CVTypeArray TypeRecords;
74 
75  std::unique_ptr<BinaryStream> HashStream;
78  HashTable HashAdjusters;
79 
80  const TpiStreamHeader *Header;
81 };
82 }
83 }
84 
85 #endif
TpiStream(PDBFile &File, std::unique_ptr< msf::MappedBlockStream > Stream)
Definition: TpiStream.cpp:34
FixedStreamArray< support::ulittle32_t > getHashValues() const
Definition: TpiStream.cpp:147
codeview::LazyRandomTypeCollection & typeCollection()
Definition: TpiStream.h:59
const codeview::CVTypeArray & typeArray() const
Definition: TpiStream.h:57
HashTable & getHashAdjusters()
Definition: TpiStream.cpp:155
uint16_t getTypeHashStreamIndex() const
Definition: TpiStream.cpp:132
uint32_t getHashKeySize() const
Definition: TpiStream.cpp:141
uint32_t TypeIndexEnd() const
Definition: TpiStream.cpp:126
FixedStreamArray< codeview::TypeIndexOffset > getTypeIndexOffsets() const
Definition: TpiStream.cpp:151
A range adaptor for a pair of iterators.
uint16_t getTypeHashStreamAuxIndex() const
Definition: TpiStream.cpp:136
BinarySubstreamRef getTypeRecordsSubstream() const
Definition: TpiStream.cpp:143
PdbRaw_TpiVer getTpiVersion() const
Definition: TpiStream.cpp:119
uint32_t getNumHashBuckets() const
Definition: TpiStream.cpp:140
uint32_t getNumTypeRecords() const
Definition: TpiStream.cpp:128
Lightweight error class with error context and mandatory checking.
Definition: Error.h:156
codeview::CVTypeRange types(bool *HadError) const
Definition: TpiStream.cpp:157
uint32_t TypeIndexBegin() const
Definition: TpiStream.cpp:124
Provides amortized O(1) random access to a CodeView type stream.