]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - contrib/llvm/include/llvm/DebugInfo/CodeView/TypeStreamMerger.h
Merge llvm, clang, lld, lldb, compiler-rt and libc++ r304149, and update
[FreeBSD/FreeBSD.git] / contrib / llvm / include / llvm / DebugInfo / CodeView / TypeStreamMerger.h
1 //===- TypeStreamMerger.h ---------------------------------------*- 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_CODEVIEW_TYPESTREAMMERGER_H
11 #define LLVM_DEBUGINFO_CODEVIEW_TYPESTREAMMERGER_H
12
13 #include "llvm/ADT/ArrayRef.h"
14 #include "llvm/ADT/SmallVector.h"
15 #include "llvm/DebugInfo/CodeView/TypeRecord.h"
16 #include "llvm/Support/Error.h"
17
18 namespace llvm {
19 namespace codeview {
20
21 class TypeIndex;
22 class TypeServerHandler;
23 class TypeTableBuilder;
24
25 /// \brief Merge one set of type records into another.  This method assumes
26 /// that all records are type records, and there are no Id records present.
27 ///
28 /// \param Dest The table to store the re-written type records into.
29 ///
30 /// \param SourceToDest A vector, indexed by the TypeIndex in the source
31 /// type stream, that contains the index of the corresponding type record
32 /// in the destination stream.
33 ///
34 /// \param Handler (optional) If non-null, an interface that gets invoked
35 /// to handle type server records.
36 ///
37 /// \param Types The collection of types to merge in.
38 ///
39 /// \returns Error::success() if the operation succeeded, otherwise an
40 /// appropriate error code.
41 Error mergeTypeRecords(TypeTableBuilder &Dest,
42                        SmallVectorImpl<TypeIndex> &SourceToDest,
43                        TypeServerHandler *Handler, const CVTypeArray &Types);
44
45 /// \brief Merge one set of id records into another.  This method assumes
46 /// that all records are id records, and there are no Type records present.
47 /// However, since Id records can refer back to Type records, this method
48 /// assumes that the referenced type records have also been merged into
49 /// another type stream (for example using the above method), and accepts
50 /// the mapping from source to dest for that stream so that it can re-write
51 /// the type record mappings accordingly.
52 ///
53 /// \param Dest The table to store the re-written id records into.
54 ///
55 /// \param Types The mapping to use for the type records that these id
56 /// records refer to.
57 ///
58 /// \param SourceToDest A vector, indexed by the TypeIndex in the source
59 /// id stream, that contains the index of the corresponding id record
60 /// in the destination stream.
61 ///
62 /// \param Ids The collection of id records to merge in.
63 ///
64 /// \returns Error::success() if the operation succeeded, otherwise an
65 /// appropriate error code.
66 Error mergeIdRecords(TypeTableBuilder &Dest, ArrayRef<TypeIndex> Types,
67                      SmallVectorImpl<TypeIndex> &SourceToDest,
68   const CVTypeArray &Ids);
69
70 /// \brief Merge a unified set of type and id records, splitting them into
71 /// separate output streams.
72 ///
73 /// \param DestIds The table to store the re-written id records into.
74 ///
75 /// \param DestTypes the table to store the re-written type records into.
76 ///
77 /// \param SourceToDest A vector, indexed by the TypeIndex in the source
78 /// id stream, that contains the index of the corresponding id record
79 /// in the destination stream.
80 ///
81 /// \param Handler (optional) If non-null, an interface that gets invoked
82 /// to handle type server records.
83 ///
84 /// \param IdsAndTypes The collection of id records to merge in.
85 ///
86 /// \returns Error::success() if the operation succeeded, otherwise an
87 /// appropriate error code.
88 Error mergeTypeAndIdRecords(TypeTableBuilder &DestIds,
89                             TypeTableBuilder &DestTypes,
90                             SmallVectorImpl<TypeIndex> &SourceToDest,
91                             TypeServerHandler *Handler,
92   const CVTypeArray &IdsAndTypes);
93
94 } // end namespace codeview
95 } // end namespace llvm
96
97 #endif // LLVM_DEBUGINFO_CODEVIEW_TYPESTREAMMERGER_H