LLVM 23.0.0git
AcceleratorRecordsSaver.h
Go to the documentation of this file.
1//===- AcceleratorRecordsSaver.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_LIB_DWARFLINKER_PARALLEL_ACCELERATORRECORDSSAVER_H
10#define LLVM_LIB_DWARFLINKER_PARALLEL_ACCELERATORRECORDSSAVER_H
11
12#include "DIEAttributeCloner.h"
15#include "DWARFLinkerTypeUnit.h"
16
17namespace llvm {
18namespace dwarf_linker {
19namespace parallel {
20
21/// This class helps to store information for accelerator entries.
22/// It prepares accelerator info for the certain DIE and store it inside
23/// OutUnit.
25public:
30
35
36 /// Save accelerator info for the specified \p OutDIE inside OutUnit.
37 /// Side effects: set attributes in \p AttrInfo.
38 void save(const DWARFDebugInfoEntry *InputDieEntry, DIE *OutDIE,
40
41protected:
45
46 void saveObjC(const DWARFDebugInfoEntry *InputDieEntry, DIE *OutDIE,
47 AttributesInfo &AttrInfo);
48
49 void saveNameRecord(const DWARFDebugInfoEntry *InputDieEntry,
50 StringEntry *Name, DIE *OutDIE, dwarf::Tag Tag,
51 bool AvoidForPubSections);
52 void saveNamespaceRecord(const DWARFDebugInfoEntry *InputDieEntry,
53 StringEntry *Name, DIE *OutDIE, dwarf::Tag Tag,
55 void saveObjCNameRecord(const DWARFDebugInfoEntry *InputDieEntry,
56 StringEntry *Name, DIE *OutDIE, dwarf::Tag Tag);
57 void saveTypeRecord(const DWARFDebugInfoEntry *InputDieEntry,
58 StringEntry *Name, DIE *OutDIE, dwarf::Tag Tag,
59 uint32_t QualifiedNameHash, bool ObjcClassImplementation,
61
62 /// Return the output offset of \p InputDieEntry's immediate
63 /// non-declaration parent, for use as the DW_IDX_parent field of a name
64 /// index entry. Matches classic's one-level lookup: does not walk past a
65 /// pruned or declaration parent to find a surviving ancestor. Returns
66 /// std::nullopt if there is no usable parent.
67 std::optional<uint64_t>
69
70 /// Global linking data.
72
73 /// Comiple unit corresponding to input DWARF.
75
76 /// Compile unit or Artificial type unit corresponding to the output DWARF.
78};
79
80} // end of namespace parallel
81} // end of namespace dwarf_linker
82} // end of namespace llvm
83
84#endif // LLVM_LIB_DWARFLINKER_PARALLEL_ACCELERATORRECORDSSAVER_H
A structured debug information entry.
Definition DIE.h:828
DWARFDebugInfoEntry - A DIE with only the minimum required data.
CompileUnit & InUnit
Comiple unit corresponding to input DWARF.
AcceleratorRecordsSaver(LinkingGlobalData &GlobalData, CompileUnit &InUnit, CompileUnit::OutputUnitVariantPtr OutUnit)
void saveNameRecord(const DWARFDebugInfoEntry *InputDieEntry, StringEntry *Name, DIE *OutDIE, dwarf::Tag Tag, bool AvoidForPubSections)
void saveObjC(const DWARFDebugInfoEntry *InputDieEntry, DIE *OutDIE, AttributesInfo &AttrInfo)
void saveObjCNameRecord(const DWARFDebugInfoEntry *InputDieEntry, StringEntry *Name, DIE *OutDIE, dwarf::Tag Tag)
CompileUnit::OutputUnitVariantPtr OutUnit
Compile unit or Artificial type unit corresponding to the output DWARF.
AcceleratorRecordsSaver(LinkingGlobalData &GlobalData, CompileUnit &InUnit, CompileUnit *OutUnit)
AcceleratorRecordsSaver(LinkingGlobalData &GlobalData, CompileUnit &InUnit, TypeUnit *OutUnit)
std::optional< uint64_t > getDefiningParentOutOffset(const DWARFDebugInfoEntry *InputDieEntry)
Return the output offset of InputDieEntry's immediate non-declaration parent, for use as the DW_IDX_p...
void saveTypeRecord(const DWARFDebugInfoEntry *InputDieEntry, StringEntry *Name, DIE *OutDIE, dwarf::Tag Tag, uint32_t QualifiedNameHash, bool ObjcClassImplementation, TypeEntry *TypeEntry)
void save(const DWARFDebugInfoEntry *InputDieEntry, DIE *OutDIE, AttributesInfo &AttrInfo, TypeEntry *TypeEntry)
Save accelerator info for the specified OutDIE inside OutUnit.
void saveNamespaceRecord(const DWARFDebugInfoEntry *InputDieEntry, StringEntry *Name, DIE *OutDIE, dwarf::Tag Tag, TypeEntry *TypeEntry)
Stores all information related to a compile unit, be it in its original instance of the object file o...
This class keeps data and services common for the whole linking process.
Type Unit is used to represent an artificial compilation unit which keeps all type information.
StringMapEntry< std::atomic< TypeEntryBody * > > TypeEntry
Definition TypePool.h:28
StringMapEntry< EmptyStringSetTag > StringEntry
StringEntry keeps data of the string: the length, external offset and a string body which is placed r...
Definition StringPool.h:23
This is an optimization pass for GlobalISel generic memory operations.
Information gathered and exchanged between the various clone*Attr helpers about the attributes of a p...