LLVM 20.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"
14#include "llvm/Support/Error.h"
15
16namespace llvm {
17template <typename T> class SmallVectorImpl;
18namespace codeview {
19
20class TypeIndex;
21struct GloballyHashedType;
22class GlobalTypeTableBuilder;
23class MergingTypeTableBuilder;
24
25/// Used to forward information about PCH.OBJ (precompiled) files, when
26/// applicable.
30};
31
32/// Merge one set of type records into another. This method assumes
33/// that all records are type records, and there are no Id records present.
34///
35/// \param Dest The table to store the re-written type records into.
36///
37/// \param SourceToDest A vector, indexed by the TypeIndex in the source
38/// type stream, that contains the index of the corresponding type record
39/// in the destination stream.
40///
41/// \param Types The collection of types to merge in.
42///
43/// \returns Error::success() if the operation succeeded, otherwise an
44/// appropriate error code.
46 SmallVectorImpl<TypeIndex> &SourceToDest,
47 const CVTypeArray &Types);
48
49/// Merge one set of id records into another. This method assumes
50/// that all records are id records, and there are no Type records present.
51/// However, since Id records can refer back to Type records, this method
52/// assumes that the referenced type records have also been merged into
53/// another type stream (for example using the above method), and accepts
54/// the mapping from source to dest for that stream so that it can re-write
55/// the type record mappings accordingly.
56///
57/// \param Dest The table to store the re-written id records into.
58///
59/// \param Types The mapping to use for the type records that these id
60/// records refer to.
61///
62/// \param SourceToDest A vector, indexed by the TypeIndex in the source
63/// id stream, that contains the index of the corresponding id record
64/// in the destination stream.
65///
66/// \param Ids The collection of id records to merge in.
67///
68/// \returns Error::success() if the operation succeeded, otherwise an
69/// appropriate error code.
71 SmallVectorImpl<TypeIndex> &SourceToDest,
72 const CVTypeArray &Ids);
73
74/// Merge a unified set of type and id records, splitting them into
75/// separate output streams.
76///
77/// \param DestIds The table to store the re-written id records into.
78///
79/// \param DestTypes the table to store the re-written type records into.
80///
81/// \param SourceToDest A vector, indexed by the TypeIndex in the source
82/// id stream, that contains the index of the corresponding id record
83/// in the destination stream.
84///
85/// \param IdsAndTypes The collection of id records to merge in.
86///
87/// \returns Error::success() if the operation succeeded, otherwise an
88/// appropriate error code.
90 MergingTypeTableBuilder &DestTypes,
91 SmallVectorImpl<TypeIndex> &SourceToDest,
92 const CVTypeArray &IdsAndTypes,
93 std::optional<PCHMergerInfo> &PCHInfo);
94
96 GlobalTypeTableBuilder &DestTypes,
97 SmallVectorImpl<TypeIndex> &SourceToDest,
98 const CVTypeArray &IdsAndTypes,
100 std::optional<PCHMergerInfo> &PCHInfo);
101
103 SmallVectorImpl<TypeIndex> &SourceToDest,
104 const CVTypeArray &Types,
106 std::optional<PCHMergerInfo> &PCHInfo);
107
109 SmallVectorImpl<TypeIndex> &SourceToDest,
110 const CVTypeArray &Ids,
112
113} // end namespace codeview
114} // end namespace llvm
115
116#endif // LLVM_DEBUGINFO_CODEVIEW_TYPESTREAMMERGER_H
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:160
This class consists of common code factored out of the SmallVector class to reduce code duplication b...
Definition: SmallVector.h:586
Error mergeIdRecords(MergingTypeTableBuilder &Dest, ArrayRef< TypeIndex > Types, SmallVectorImpl< TypeIndex > &SourceToDest, const CVTypeArray &Ids)
Merge one set of id records into another.
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.
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.