LLVM  6.0.0svn
TypeStreamMerger.h
Go to the documentation of this file.
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"
16 #include "llvm/Support/Error.h"
17 
18 namespace llvm {
19 namespace codeview {
20 
21 class TypeIndex;
22 struct GloballyHashedType;
23 class GlobalTypeTableBuilder;
24 class MergingTypeTableBuilder;
25 
26 /// \brief Merge one set of type records into another. This method assumes
27 /// that all records are type records, and there are no Id records present.
28 ///
29 /// \param Dest The table to store the re-written type records into.
30 ///
31 /// \param SourceToDest A vector, indexed by the TypeIndex in the source
32 /// type stream, that contains the index of the corresponding type record
33 /// in the destination stream.
34 ///
35 /// \param Types The collection of types to merge in.
36 ///
37 /// \returns Error::success() if the operation succeeded, otherwise an
38 /// appropriate error code.
39 Error mergeTypeRecords(MergingTypeTableBuilder &Dest,
40  SmallVectorImpl<TypeIndex> &SourceToDest,
41  const CVTypeArray &Types);
42 
43 /// \brief Merge one set of id records into another. This method assumes
44 /// that all records are id records, and there are no Type records present.
45 /// However, since Id records can refer back to Type records, this method
46 /// assumes that the referenced type records have also been merged into
47 /// another type stream (for example using the above method), and accepts
48 /// the mapping from source to dest for that stream so that it can re-write
49 /// the type record mappings accordingly.
50 ///
51 /// \param Dest The table to store the re-written id records into.
52 ///
53 /// \param Types The mapping to use for the type records that these id
54 /// records refer to.
55 ///
56 /// \param SourceToDest A vector, indexed by the TypeIndex in the source
57 /// id stream, that contains the index of the corresponding id record
58 /// in the destination stream.
59 ///
60 /// \param Ids The collection of id records to merge in.
61 ///
62 /// \returns Error::success() if the operation succeeded, otherwise an
63 /// appropriate error code.
64 Error mergeIdRecords(MergingTypeTableBuilder &Dest, ArrayRef<TypeIndex> Types,
65  SmallVectorImpl<TypeIndex> &SourceToDest,
66  const CVTypeArray &Ids);
67 
68 /// \brief Merge a unified set of type and id records, splitting them into
69 /// separate output streams.
70 ///
71 /// \param DestIds The table to store the re-written id records into.
72 ///
73 /// \param DestTypes the table to store the re-written type records into.
74 ///
75 /// \param SourceToDest A vector, indexed by the TypeIndex in the source
76 /// id stream, that contains the index of the corresponding id record
77 /// in the destination stream.
78 ///
79 /// \param IdsAndTypes The collection of id records to merge in.
80 ///
81 /// \returns Error::success() if the operation succeeded, otherwise an
82 /// appropriate error code.
83 Error mergeTypeAndIdRecords(MergingTypeTableBuilder &DestIds,
84  MergingTypeTableBuilder &DestTypes,
85  SmallVectorImpl<TypeIndex> &SourceToDest,
86  const CVTypeArray &IdsAndTypes);
87 
88 Error mergeTypeAndIdRecords(GlobalTypeTableBuilder &DestIds,
89  GlobalTypeTableBuilder &DestTypes,
90  SmallVectorImpl<TypeIndex> &SourceToDest,
91  const CVTypeArray &IdsAndTypes,
92  ArrayRef<GloballyHashedType> Hashes);
93 
94 Error mergeTypeRecords(GlobalTypeTableBuilder &Dest,
95  SmallVectorImpl<TypeIndex> &SourceToDest,
96  const CVTypeArray &Types,
97  ArrayRef<GloballyHashedType> Hashes);
98 
99 Error mergeIdRecords(GlobalTypeTableBuilder &Dest, ArrayRef<TypeIndex> Types,
100  SmallVectorImpl<TypeIndex> &SourceToDest,
101  const CVTypeArray &Ids,
102  ArrayRef<GloballyHashedType> Hashes);
103 
104 } // end namespace codeview
105 } // end namespace llvm
106 
107 #endif // LLVM_DEBUGINFO_CODEVIEW_TYPESTREAMMERGER_H
Compute iterated dominance frontiers using a linear time algorithm.
Definition: AllocatorList.h:24
VarStreamArray< CVType > CVTypeArray
Definition: TypeRecord.h:43
Error mergeTypeAndIdRecords(MergingTypeTableBuilder &DestIds, MergingTypeTableBuilder &DestTypes, SmallVectorImpl< TypeIndex > &SourceToDest, const CVTypeArray &IdsAndTypes)
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.
Error mergeIdRecords(MergingTypeTableBuilder &Dest, ArrayRef< TypeIndex > Types, SmallVectorImpl< TypeIndex > &SourceToDest, const CVTypeArray &Ids)
Merge one set of id records into another.