21 if (
GlobalData.getOptions().AccelTables.empty())
27 if (AttrInfo.
Name ==
nullptr)
31 switch (InputDieEntry->
getTag()) {
32 case dwarf::DW_TAG_array_type:
33 case dwarf::DW_TAG_class_type:
34 case dwarf::DW_TAG_enumeration_type:
35 case dwarf::DW_TAG_pointer_type:
36 case dwarf::DW_TAG_reference_type:
37 case dwarf::DW_TAG_string_type:
38 case dwarf::DW_TAG_structure_type:
39 case dwarf::DW_TAG_subroutine_type:
40 case dwarf::DW_TAG_template_alias:
41 case dwarf::DW_TAG_typedef:
42 case dwarf::DW_TAG_union_type:
43 case dwarf::DW_TAG_ptr_to_member_type:
44 case dwarf::DW_TAG_set_type:
45 case dwarf::DW_TAG_subrange_type:
46 case dwarf::DW_TAG_base_type:
47 case dwarf::DW_TAG_const_type:
48 case dwarf::DW_TAG_constant:
49 case dwarf::DW_TAG_file_type:
50 case dwarf::DW_TAG_namelist:
51 case dwarf::DW_TAG_packed_type:
52 case dwarf::DW_TAG_volatile_type:
53 case dwarf::DW_TAG_restrict_type:
54 case dwarf::DW_TAG_atomic_type:
55 case dwarf::DW_TAG_interface_type:
56 case dwarf::DW_TAG_unspecified_type:
57 case dwarf::DW_TAG_shared_type:
58 case dwarf::DW_TAG_immutable_type:
59 case dwarf::DW_TAG_rvalue_reference_type: {
70 uint64_t RuntimeLang =
74 bool ObjCClassIsImplementation =
75 (RuntimeLang == dwarf::DW_LANG_ObjC ||
76 RuntimeLang == dwarf::DW_LANG_ObjC_plus_plus) &&
87 std::optional<UnitEntryPairTy> RefDie =
CU->resolveDIEReference(
89 if (!RefDie || !RefDie->DieEntry)
92 return CU->getDIE(RefDie->DieEntry);
95 InputDieEntry->
getTag(), Hash, ObjCClassIsImplementation,
102 RuntimeLang == dwarf::DW_LANG_Swift &&
110 case dwarf::DW_TAG_namespace: {
111 if (AttrInfo.
Name ==
nullptr)
113 GlobalData.getStringPool().insert(
"(anonymous namespace)").first;
118 case dwarf::DW_TAG_imported_declaration: {
119 if (AttrInfo.
Name !=
nullptr)
123 case dwarf::DW_TAG_compile_unit:
124 case dwarf::DW_TAG_lexical_block: {
133 !(InputDieEntry->
getTag() == dwarf::DW_TAG_variable &&
137 InputDieEntry, AttrInfo.
Name, OutDIE, InputDieEntry->
getTag(),
138 InputDieEntry->
getTag() == dwarf::DW_TAG_inlined_subroutine,
150 InputDieEntry->
getTag() ==
151 dwarf::DW_TAG_inlined_subroutine,
156 (InputDieEntry->
getTag() != dwarf::DW_TAG_inlined_subroutine)) {
157 if (std::optional<StringRef> Name =
160 GlobalData.getStringPool().insert(*Name).first;
177 std::optional<ObjCSelectorNames> Names =
183 GlobalData.getStringPool().insert(Names->Selector).first;
187 GlobalData.getStringPool().insert(Names->ClassName).first;
190 if (Names->ClassNameNoCategory) {
192 GlobalData.getStringPool().insert(*Names->ClassNameNoCategory).first;
196 if (Names->MethodNameNoCategory) {
198 GlobalData.getStringPool().insert(*Names->MethodNameNoCategory).first;
211 constexpr uint64_t NotClonedInPlainDWARF = 0;
213 std::optional<uint32_t> ParentIdx = InputDieEntry->
getParentIdx();
220 uint64_t ParentOutOffset =
InUnit.getDieOutOffset(*ParentIdx);
221 if (ParentOutOffset == NotClonedInPlainDWARF)
223 return ParentOutOffset;
238 Info.AvoidForPubSections = AvoidForPubSections;
240 OutUnit.getAsCompileUnit()->saveAcceleratorInfo(Info);
251 Info.OutOffset = 0xbaddef;
253 Info.AvoidForPubSections = AvoidForPubSections;
254 Info.OutDIE = OutDIE;
255 Info.TypeEntryBodyPtr =
TypeEntry->getValue().load();
257 OutUnit.getAsTypeUnit()->saveAcceleratorInfo(Info);
272 OutUnit.getAsCompileUnit()->saveAcceleratorInfo(Info);
284 Info.OutOffset = 0xbaddef;
286 Info.OutDIE = OutDIE;
287 Info.TypeEntryBodyPtr =
TypeEntry->getValue().load();
289 OutUnit.getAsTypeUnit()->saveAcceleratorInfo(Info);
304 Info.AvoidForPubSections =
true;
306 OutUnit.getAsCompileUnit()->saveAcceleratorInfo(Info);
317 Info.OutOffset = 0xbaddef;
319 Info.AvoidForPubSections =
true;
320 Info.OutDIE = OutDIE;
321 Info.TypeEntryBodyPtr =
TypeEntry->getValue().load();
323 OutUnit.getAsTypeUnit()->saveAcceleratorInfo(Info);
339 Info.QualifiedNameHash = QualifiedNameHash;
340 Info.ObjcClassImplementation = ObjcClassImplementation;
342 OutUnit.getAsCompileUnit()->saveAcceleratorInfo(Info);
354 Info.OutOffset = 0xbaddef;
356 Info.QualifiedNameHash = QualifiedNameHash;
357 Info.ObjcClassImplementation = ObjcClassImplementation;
358 Info.OutDIE = OutDIE;
359 Info.TypeEntryBodyPtr =
TypeEntry->getValue().load();
360 OutUnit.getAsTypeUnit()->saveAcceleratorInfo(Info);
assert(UImm &&(UImm !=~static_cast< T >(0)) &&"Invalid immediate!")
A structured debug information entry.
unsigned getOffset() const
Get the compile/type unit relative offset of this DIE.
DWARFDebugInfoEntry - A DIE with only the minimum required data.
dwarf::Tag getTag() const
std::optional< uint32_t > getParentIdx() const
Returns index of the parent die.
Utility class that carries the DWARF compile/type unit and the debug info entry in an object.
LLVM_ABI const char * getShortName() const
Return the DIE short name resolving DW_AT_specification or DW_AT_abstract_origin references if necess...
LLVM_ABI std::optional< DWARFFormValue > find(dwarf::Attribute Attr) const
Extract the specified attribute from this DIE.
DWARFUnit * getDwarfUnit() const
LLVM_ABI const char * getLinkageName() const
Return the DIE linkage name resolving DW_AT_specification or DW_AT_abstract_origin references if nece...
constexpr bool empty() const
Check if the string is empty.
CompileUnit & InUnit
Comiple unit corresponding to input DWARF.
void saveObjCNameRecord(const DWARFDebugInfoEntry *InputDieEntry, StringEntry *Name, DIE *OutDIE, dwarf::Tag Tag, TypeEntry *TypeEntry)
void saveNameRecord(const DWARFDebugInfoEntry *InputDieEntry, StringEntry *Name, DIE *OutDIE, dwarf::Tag Tag, bool AvoidForPubSections, TypeEntry *TypeEntry)
CompileUnit::OutputUnitVariantPtr OutUnit
Compile unit or Artificial type unit corresponding to the output DWARF.
LinkingGlobalData & GlobalData
Global linking data.
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)
void saveObjC(const DWARFDebugInfoEntry *InputDieEntry, DIE *OutDIE, AttributesInfo &AttrInfo, TypeEntry *TypeEntry)
Stores all information related to a compile unit, be it in its original instance of the object file o...
StringMapEntry< std::atomic< TypeEntryBody * > > TypeEntry
LLVM_ABI bool hasImplicitAddressLocation(const DWARFDie &Die)
Test if the location of variable Die contains a global address but only uses to compute the variable'...
StringMapEntry< EmptyStringSetTag > StringEntry
StringEntry keeps data of the string: the length, external offset and a string body which is placed r...
LLVM_ABI uint32_t hashFullyQualifiedName(DWARFDie Die, function_ref< DWARFDie(const DWARFDie &, const DWARFFormValue &)> ResolveRef)
Hash the fully qualified name of type Die for the Apple accelerator tables.
std::optional< uint64_t > toUnsigned(const std::optional< DWARFFormValue > &V)
Take an optional DWARFFormValue and try to extract an unsigned constant.
This is an optimization pass for GlobalISel generic memory operations.
LLVM_ABI std::optional< StringRef > StripTemplateParameters(StringRef Name)
If Name is the name of a templated function that includes template parameters, returns a substring of...
@ Ref
The access may reference the value stored in memory.
uint32_t djbHash(StringRef Buffer, uint32_t H=5381)
The Bernstein hash function used by the DWARF accelerator tables.
LLVM_ABI std::optional< ObjCSelectorNames > getObjCNamesIfSelector(StringRef Name)
If Name is the AT_name of a DIE which refers to an Objective-C selector, returns an instance of ObjCS...
Information gathered and exchanged between the various clone*Attr helpers about the attributes of a p...
bool IsDeclaration
Is this DIE only a declaration?
bool HasRanges
Does the DIE have a ranges attribute?
bool HasLiveAddress
Does the DIE have an address pointing to live code section?
StringEntry * MangledName
Mangled Name.
StringEntry * Name
Short Name.
This structure keeps fields which would be used for creating accelerator table.
AccelType Type
Type of this accelerator record.
TypeUnitAccelInfo extends AccelInfo structure with type specific fields.