LLVM 22.0.0git
TpiStream.h
Go to the documentation of this file.
1//===- TpiStream.cpp - PDB Type Info (TPI) Stream 2 Access ------*- C++ -*-===//
2//
3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4// See https://llvm.org/LICENSE.txt for license information.
5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6//
7//===----------------------------------------------------------------------===//
8
9#ifndef LLVM_DEBUGINFO_PDB_NATIVE_TPISTREAM_H
10#define LLVM_DEBUGINFO_PDB_NATIVE_TPISTREAM_H
11
18
19#include "llvm/Support/Error.h"
20
21namespace llvm {
22class BinaryStream;
23namespace codeview {
24class TypeIndex;
25struct TypeIndexOffset;
26class LazyRandomTypeCollection;
27}
28namespace msf {
29class MappedBlockStream;
30}
31namespace pdb {
32struct TpiStreamHeader;
33class PDBFile;
34
35class TpiStream {
36 friend class TpiStreamBuilder;
37
38public:
40 std::unique_ptr<msf::MappedBlockStream> Stream);
43
45
51
56 getTypeIndexOffsets() const;
58
59 LLVM_ABI codeview::CVTypeRange types(bool *HadError) const;
60 const codeview::CVTypeArray &typeArray() const { return TypeRecords; }
61
63
66
67 LLVM_ABI std::vector<codeview::TypeIndex>
69
71
73
75
77
78 LLVM_ABI bool supportsTypeLookup() const;
79
80private:
81 PDBFile &Pdb;
82 std::unique_ptr<msf::MappedBlockStream> Stream;
83
84 std::unique_ptr<codeview::LazyRandomTypeCollection> Types;
85
86 BinarySubstreamRef TypeRecordsSubstream;
87
88 codeview::CVTypeArray TypeRecords;
89
90 std::unique_ptr<BinaryStream> HashStream;
94
95 std::vector<std::vector<codeview::TypeIndex>> HashMap;
96
97 const TpiStreamHeader *Header;
98};
99}
100}
101
102#endif
Lightweight arrays that are backed by an arbitrary BinaryStream.
#define LLVM_ABI
Definition: Compiler.h:213
std::string Name
uint32_t Index
Lightweight error class with error context and mandatory checking.
Definition: Error.h:159
Tagged union holding either a T or a Error.
Definition: Error.h:485
FixedStreamArray is similar to VarStreamArray, except with each record having a fixed-length.
StringRef - Represent a constant reference to a string, i.e.
Definition: StringRef.h:55
Provides amortized O(1) random access to a CodeView type stream.
A 32-bit type reference.
Definition: TypeIndex.h:97
A range adaptor for a pair of iterators.
LLVM_ABI uint32_t getHashKeySize() const
Definition: TpiStream.cpp:141
LLVM_ABI BinarySubstreamRef getTypeRecordsSubstream() const
Definition: TpiStream.cpp:225
LLVM_ABI HashTable< support::ulittle32_t > & getHashAdjusters()
Definition: TpiStream.cpp:237
LLVM_ABI std::vector< codeview::TypeIndex > findRecordsByName(StringRef Name) const
Definition: TpiStream.cpp:159
LLVM_ABI uint32_t TypeIndexBegin() const
Definition: TpiStream.cpp:124
LLVM_ABI Error commit()
Definition: TpiStream.cpp:245
LLVM_ABI PdbRaw_TpiVer getTpiVersion() const
Definition: TpiStream.cpp:119
LLVM_ABI codeview::CVTypeRange types(bool *HadError) const
Definition: TpiStream.cpp:241
LLVM_ABI void buildHashMap()
Definition: TpiStream.cpp:143
LLVM_ABI FixedStreamArray< codeview::TypeIndexOffset > getTypeIndexOffsets() const
Definition: TpiStream.cpp:233
LLVM_ABI codeview::CVType getType(codeview::TypeIndex Index)
Definition: TpiStream.cpp:220
LLVM_ABI uint16_t getTypeHashStreamAuxIndex() const
Definition: TpiStream.cpp:136
const codeview::CVTypeArray & typeArray() const
Definition: TpiStream.h:60
LLVM_ABI uint16_t getTypeHashStreamIndex() const
Definition: TpiStream.cpp:132
LLVM_ABI Error reload()
Definition: TpiStream.cpp:40
LLVM_ABI bool supportsTypeLookup() const
Definition: TpiStream.cpp:176
LLVM_ABI FixedStreamArray< support::ulittle32_t > getHashValues() const
Definition: TpiStream.cpp:229
LLVM_ABI Expected< codeview::TypeIndex > findFullDeclForForwardRef(codeview::TypeIndex ForwardRefTI) const
Definition: TpiStream.cpp:179
LLVM_ABI uint32_t getNumTypeRecords() const
Definition: TpiStream.cpp:128
codeview::LazyRandomTypeCollection & typeCollection()
Definition: TpiStream.h:62
LLVM_ABI uint32_t TypeIndexEnd() const
Definition: TpiStream.cpp:126
LLVM_ABI uint32_t getNumHashBuckets() const
Definition: TpiStream.cpp:140
This is an optimization pass for GlobalISel generic memory operations.
Definition: AddressRanges.h:18