1 //===- TypeMerger.h ---------------------------------------------*- C++ -*-===//
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
7 //===----------------------------------------------------------------------===//
9 #ifndef LLD_COFF_TYPEMERGER_H
10 #define LLD_COFF_TYPEMERGER_H
13 #include "llvm/DebugInfo/CodeView/GlobalTypeTableBuilder.h"
14 #include "llvm/DebugInfo/CodeView/MergingTypeTableBuilder.h"
15 #include "llvm/Support/Allocator.h"
22 TypeMerger(llvm::BumpPtrAllocator
&alloc
)
23 : typeTable(alloc
), iDTable(alloc
), globalTypeTable(alloc
),
24 globalIDTable(alloc
) {}
26 /// Get the type table or the global type table if /DEBUG:GHASH is enabled.
27 inline llvm::codeview::TypeCollection
&getTypeTable() {
28 if (config
->debugGHashes
)
29 return globalTypeTable
;
33 /// Get the ID table or the global ID table if /DEBUG:GHASH is enabled.
34 inline llvm::codeview::TypeCollection
&getIDTable() {
35 if (config
->debugGHashes
)
40 /// Type records that will go into the PDB TPI stream.
41 llvm::codeview::MergingTypeTableBuilder typeTable
;
43 /// Item records that will go into the PDB IPI stream.
44 llvm::codeview::MergingTypeTableBuilder iDTable
;
46 /// Type records that will go into the PDB TPI stream (for /DEBUG:GHASH)
47 llvm::codeview::GlobalTypeTableBuilder globalTypeTable
;
49 /// Item records that will go into the PDB IPI stream (for /DEBUG:GHASH)
50 llvm::codeview::GlobalTypeTableBuilder globalIDTable
;
53 /// Map from type index and item index in a type server PDB to the
54 /// corresponding index in the destination PDB.
56 llvm::SmallVector
<llvm::codeview::TypeIndex
, 0> tpiMap
;
57 llvm::SmallVector
<llvm::codeview::TypeIndex
, 0> ipiMap
;
58 bool isTypeServerMap
= false;
59 bool isPrecompiledTypeMap
= false;