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;
27}
28namespace msf {
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>
68 findRecordsByName(StringRef Name) const;
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
An interface for accessing data in a stream-like format, but which discourages copying.
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
MappedBlockStream represents data stored in an MSF file into chunks of a particular size (called the ...
LLVM_ABI uint32_t getHashKeySize() const
LLVM_ABI BinarySubstreamRef getTypeRecordsSubstream() const
LLVM_ABI HashTable< support::ulittle32_t > & getHashAdjusters()
LLVM_ABI std::vector< codeview::TypeIndex > findRecordsByName(StringRef Name) const
LLVM_ABI uint32_t TypeIndexBegin() const
LLVM_ABI Error commit()
LLVM_ABI PdbRaw_TpiVer getTpiVersion() const
friend class TpiStreamBuilder
Definition TpiStream.h:36
LLVM_ABI codeview::CVTypeRange types(bool *HadError) const
LLVM_ABI void buildHashMap()
LLVM_ABI TpiStream(PDBFile &File, std::unique_ptr< msf::MappedBlockStream > Stream)
Definition TpiStream.cpp:35
LLVM_ABI FixedStreamArray< codeview::TypeIndexOffset > getTypeIndexOffsets() const
LLVM_ABI codeview::CVType getType(codeview::TypeIndex Index)
LLVM_ABI uint16_t getTypeHashStreamAuxIndex() const
const codeview::CVTypeArray & typeArray() const
Definition TpiStream.h:60
LLVM_ABI uint16_t getTypeHashStreamIndex() const
LLVM_ABI Error reload()
Definition TpiStream.cpp:40
LLVM_ABI bool supportsTypeLookup() const
LLVM_ABI FixedStreamArray< support::ulittle32_t > getHashValues() const
LLVM_ABI Expected< codeview::TypeIndex > findFullDeclForForwardRef(codeview::TypeIndex ForwardRefTI) const
LLVM_ABI uint32_t getNumTypeRecords() const
codeview::LazyRandomTypeCollection & typeCollection()
Definition TpiStream.h:62
LLVM_ABI uint32_t TypeIndexEnd() const
LLVM_ABI uint32_t getNumHashBuckets() const
iterator_range< CVTypeArray::Iterator > CVTypeRange
Definition CVRecord.h:128
CVRecord< TypeLeafKind > CVType
Definition CVRecord.h:64
VarStreamArray< CVType > CVTypeArray
Definition CVRecord.h:127
This is an optimization pass for GlobalISel generic memory operations.