LLVM 22.0.0git
TypeStreamMerger.h
Go to the documentation of this file.
1//===- TypeStreamMerger.h ---------------------------------------*- 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_CODEVIEW_TYPESTREAMMERGER_H
10#define LLVM_DEBUGINFO_CODEVIEW_TYPESTREAMMERGER_H
11
12#include "llvm/ADT/ArrayRef.h"
15#include "llvm/Support/Error.h"
16
17namespace llvm {
18template <typename T> class SmallVectorImpl;
19namespace codeview {
20
21class TypeIndex;
22struct GloballyHashedType;
23class GlobalTypeTableBuilder;
24class MergingTypeTableBuilder;
25
26/// Used to forward information about PCH.OBJ (precompiled) files, when
27/// applicable.
31};
32
33/// Merge one set of type records into another. This method assumes
34/// that all records are type records, and there are no Id records present.
35///
36/// \param Dest The table to store the re-written type records into.
37///
38/// \param SourceToDest A vector, indexed by the TypeIndex in the source
39/// type stream, that contains the index of the corresponding type record
40/// in the destination stream.
41///
42/// \param Types The collection of types to merge in.
43///
44/// \returns Error::success() if the operation succeeded, otherwise an
45/// appropriate error code.
47 SmallVectorImpl<TypeIndex> &SourceToDest,
48 const CVTypeArray &Types);
49
50/// Merge one set of id records into another. This method assumes
51/// that all records are id records, and there are no Type records present.
52/// However, since Id records can refer back to Type records, this method
53/// assumes that the referenced type records have also been merged into
54/// another type stream (for example using the above method), and accepts
55/// the mapping from source to dest for that stream so that it can re-write
56/// the type record mappings accordingly.
57///
58/// \param Dest The table to store the re-written id records into.
59///
60/// \param Types The mapping to use for the type records that these id
61/// records refer to.
62///
63/// \param SourceToDest A vector, indexed by the TypeIndex in the source
64/// id stream, that contains the index of the corresponding id record
65/// in the destination stream.
66///
67/// \param Ids The collection of id records to merge in.
68///
69/// \returns Error::success() if the operation succeeded, otherwise an
70/// appropriate error code.
73 SmallVectorImpl<TypeIndex> &SourceToDest,
74 const CVTypeArray &Ids);
75
76/// Merge a unified set of type and id records, splitting them into
77/// separate output streams.
78///
79/// \param DestIds The table to store the re-written id records into.
80///
81/// \param DestTypes the table to store the re-written type records into.
82///
83/// \param SourceToDest A vector, indexed by the TypeIndex in the source
84/// id stream, that contains the index of the corresponding id record
85/// in the destination stream.
86///
87/// \param IdsAndTypes The collection of id records to merge in.
88///
89/// \returns Error::success() if the operation succeeded, otherwise an
90/// appropriate error code.
92 MergingTypeTableBuilder &DestTypes,
93 SmallVectorImpl<TypeIndex> &SourceToDest,
94 const CVTypeArray &IdsAndTypes,
95 std::optional<PCHMergerInfo> &PCHInfo);
96
98 GlobalTypeTableBuilder &DestTypes,
99 SmallVectorImpl<TypeIndex> &SourceToDest,
100 const CVTypeArray &IdsAndTypes,
102 std::optional<PCHMergerInfo> &PCHInfo);
103
105 SmallVectorImpl<TypeIndex> &SourceToDest,
106 const CVTypeArray &Types,
108 std::optional<PCHMergerInfo> &PCHInfo);
109
112 SmallVectorImpl<TypeIndex> &SourceToDest,
113 const CVTypeArray &Ids,
115
116} // end namespace codeview
117} // end namespace llvm
118
119#endif // LLVM_DEBUGINFO_CODEVIEW_TYPESTREAMMERGER_H
#define LLVM_ABI
Definition: Compiler.h:213
ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory),...
Definition: ArrayRef.h:41
Lightweight error class with error context and mandatory checking.
Definition: Error.h:159
This class consists of common code factored out of the SmallVector class to reduce code duplication b...
Definition: SmallVector.h:574
LLVM_ABI Error mergeIdRecords(MergingTypeTableBuilder &Dest, ArrayRef< TypeIndex > Types, SmallVectorImpl< TypeIndex > &SourceToDest, const CVTypeArray &Ids)
Merge one set of id records into another.
LLVM_ABI Error mergeTypeAndIdRecords(MergingTypeTableBuilder &DestIds, MergingTypeTableBuilder &DestTypes, SmallVectorImpl< TypeIndex > &SourceToDest, const CVTypeArray &IdsAndTypes, std::optional< PCHMergerInfo > &PCHInfo)
Merge a unified set of type and id records, splitting them into separate output streams.
LLVM_ABI Error mergeTypeRecords(MergingTypeTableBuilder &Dest, SmallVectorImpl< TypeIndex > &SourceToDest, const CVTypeArray &Types)
Merge one set of type records into another.
This is an optimization pass for GlobalISel generic memory operations.
Definition: AddressRanges.h:18
Used to forward information about PCH.OBJ (precompiled) files, when applicable.