Skip to content

Commit f176388

Browse files
authored
[lldb][DWARF] Remove obsolete calls to Supports_DW_AT_APPLE_objc_complete_type and DW_AT_decl_file_attributes_are_invalid (llvm#120226)
Depends on llvm#120225 With `llvm-gcc` support being removed from LLDB, these APIs are now trivial and can be removed too.
1 parent e0a79ee commit f176388

9 files changed

+5
-79
lines changed

lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1712,8 +1712,7 @@ DWARFASTParserClang::ParseStructureLikeDIE(const SymbolContext &sc,
17121712

17131713
if ((attrs.class_language == eLanguageTypeObjC ||
17141714
attrs.class_language == eLanguageTypeObjC_plus_plus) &&
1715-
!attrs.is_complete_objc_class &&
1716-
die.Supports_DW_AT_APPLE_objc_complete_type()) {
1715+
!attrs.is_complete_objc_class) {
17171716
// We have a valid eSymbolTypeObjCClass class symbol whose name
17181717
// matches the current objective C class that we are trying to find
17191718
// and this DIE isn't the complete definition (we checked

lldb/source/Plugins/SymbolFile/DWARF/DWARFBaseDIE.cpp

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -107,10 +107,6 @@ bool DWARFBaseDIE::HasChildren() const {
107107
return m_die && m_die->HasChildren();
108108
}
109109

110-
bool DWARFBaseDIE::Supports_DW_AT_APPLE_objc_complete_type() const {
111-
return IsValid() && GetDWARF()->Supports_DW_AT_APPLE_objc_complete_type(m_cu);
112-
}
113-
114110
DWARFAttributes DWARFBaseDIE::GetAttributes(Recurse recurse) const {
115111
if (IsValid())
116112
return m_die->GetAttributes(m_cu, recurse);

lldb/source/Plugins/SymbolFile/DWARF/DWARFUnit.cpp

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -736,10 +736,6 @@ bool DWARFUnit::LinkToSkeletonUnit(DWARFUnit &skeleton_unit) {
736736
return false; // Already linked to a different unit.
737737
}
738738

739-
bool DWARFUnit::Supports_DW_AT_APPLE_objc_complete_type() { return true; }
740-
741-
bool DWARFUnit::DW_AT_decl_file_attributes_are_invalid() { return false; }
742-
743739
bool DWARFUnit::Supports_unnamed_objc_bitfields() {
744740
if (GetProducer() == eProducerClang)
745741
return GetProducerVersion() >= llvm::VersionTuple(425, 0, 13);

lldb/source/Plugins/SymbolFile/DWARF/DWARFUnit.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -172,10 +172,6 @@ class DWARFUnit : public UserID {
172172

173173
bool LinkToSkeletonUnit(DWARFUnit &skeleton_unit);
174174

175-
bool Supports_DW_AT_APPLE_objc_complete_type();
176-
177-
bool DW_AT_decl_file_attributes_are_invalid();
178-
179175
bool Supports_unnamed_objc_bitfields();
180176

181177
SymbolFileDWARF &GetSymbolFileDWARF() const { return m_dwarf; }

lldb/source/Plugins/SymbolFile/DWARF/DebugNamesDWARFIndex.cpp

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -271,11 +271,6 @@ void DebugNamesDWARFIndex::GetCompleteObjCClass(
271271
// Report invalid
272272
continue;
273273
}
274-
DWARFUnit *cu = die.GetCU();
275-
if (!cu->Supports_DW_AT_APPLE_objc_complete_type()) {
276-
incomplete_types.push_back(die);
277-
continue;
278-
}
279274

280275
if (die.GetAttributeValueAsUnsigned(DW_AT_APPLE_objc_complete_type, 0)) {
281276
// If we find the complete version we're done.

lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp

Lines changed: 2 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -472,8 +472,7 @@ SymbolFileDWARF::SymbolFileDWARF(ObjectFileSP objfile_sp,
472472
: SymbolFileCommon(std::move(objfile_sp)), m_debug_map_module_wp(),
473473
m_debug_map_symfile(nullptr),
474474
m_context(m_objfile_sp->GetModule()->GetSectionList(), dwo_section_list),
475-
m_fetched_external_modules(false),
476-
m_supports_DW_AT_APPLE_objc_complete_type(eLazyBoolCalculate) {}
475+
m_fetched_external_modules(false) {}
477476

478477
SymbolFileDWARF::~SymbolFileDWARF() = default;
479478

@@ -2920,37 +2919,6 @@ Symbol *SymbolFileDWARF::GetObjCClassSymbol(ConstString objc_class_name) {
29202919
return objc_class_symbol;
29212920
}
29222921

2923-
// Some compilers don't emit the DW_AT_APPLE_objc_complete_type attribute. If
2924-
// they don't then we can end up looking through all class types for a complete
2925-
// type and never find the full definition. We need to know if this attribute
2926-
// is supported, so we determine this here and cache th result. We also need to
2927-
// worry about the debug map
2928-
// DWARF file
2929-
// if we are doing darwin DWARF in .o file debugging.
2930-
bool SymbolFileDWARF::Supports_DW_AT_APPLE_objc_complete_type(DWARFUnit *cu) {
2931-
if (m_supports_DW_AT_APPLE_objc_complete_type == eLazyBoolCalculate) {
2932-
m_supports_DW_AT_APPLE_objc_complete_type = eLazyBoolNo;
2933-
if (cu && cu->Supports_DW_AT_APPLE_objc_complete_type())
2934-
m_supports_DW_AT_APPLE_objc_complete_type = eLazyBoolYes;
2935-
else {
2936-
DWARFDebugInfo &debug_info = DebugInfo();
2937-
const uint32_t num_compile_units = GetNumCompileUnits();
2938-
for (uint32_t cu_idx = 0; cu_idx < num_compile_units; ++cu_idx) {
2939-
DWARFUnit *dwarf_cu = debug_info.GetUnitAtIndex(cu_idx);
2940-
if (dwarf_cu != cu &&
2941-
dwarf_cu->Supports_DW_AT_APPLE_objc_complete_type()) {
2942-
m_supports_DW_AT_APPLE_objc_complete_type = eLazyBoolYes;
2943-
break;
2944-
}
2945-
}
2946-
}
2947-
if (m_supports_DW_AT_APPLE_objc_complete_type == eLazyBoolNo &&
2948-
GetDebugMapSymfile())
2949-
return m_debug_map_symfile->Supports_DW_AT_APPLE_objc_complete_type(this);
2950-
}
2951-
return m_supports_DW_AT_APPLE_objc_complete_type == eLazyBoolYes;
2952-
}
2953-
29542922
// This function can be used when a DIE is found that is a forward declaration
29552923
// DIE and we want to try and find a type that has the complete definition.
29562924
TypeSP SymbolFileDWARF::FindCompleteObjCDefinitionTypeForDIE(
@@ -2968,8 +2936,7 @@ TypeSP SymbolFileDWARF::FindCompleteObjCDefinitionTypeForDIE(
29682936
if (type_die == die || !IsStructOrClassTag(type_die.Tag()))
29692937
return true;
29702938

2971-
if (must_be_implementation &&
2972-
type_die.Supports_DW_AT_APPLE_objc_complete_type()) {
2939+
if (must_be_implementation) {
29732940
const bool try_resolving_type = type_die.GetAttributeValueAsUnsigned(
29742941
DW_AT_APPLE_objc_complete_type, 0);
29752942
if (!try_resolving_type)

lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -223,8 +223,6 @@ class SymbolFileDWARF : public SymbolFileCommon {
223223
virtual void GetObjCMethods(ConstString class_name,
224224
llvm::function_ref<bool(DWARFDIE die)> callback);
225225

226-
bool Supports_DW_AT_APPLE_objc_complete_type(DWARFUnit *cu);
227-
228226
DebugMacrosSP ParseDebugMacros(lldb::offset_t *offset);
229227

230228
static DWARFDIE GetParentSymbolContextDIE(const DWARFDIE &die);
@@ -524,7 +522,6 @@ class SymbolFileDWARF : public SymbolFileCommon {
524522
ExternalTypeModuleMap m_external_type_modules;
525523
std::unique_ptr<DWARFIndex> m_index;
526524
bool m_fetched_external_modules : 1;
527-
LazyBool m_supports_DW_AT_APPLE_objc_complete_type;
528525

529526
typedef std::set<DIERef> DIERefSet;
530527
typedef llvm::StringMap<DIERefSet> NameToOffsetMap;

lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.cpp

Lines changed: 2 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -248,9 +248,8 @@ SymbolFile *SymbolFileDWARFDebugMap::CreateInstance(ObjectFileSP objfile_sp) {
248248
}
249249

250250
SymbolFileDWARFDebugMap::SymbolFileDWARFDebugMap(ObjectFileSP objfile_sp)
251-
: SymbolFileCommon(std::move(objfile_sp)), m_flags(), m_compile_unit_infos(),
252-
m_func_indexes(), m_glob_indexes(),
253-
m_supports_DW_AT_APPLE_objc_complete_type(eLazyBoolCalculate) {}
251+
: SymbolFileCommon(std::move(objfile_sp)), m_flags(),
252+
m_compile_unit_infos(), m_func_indexes(), m_glob_indexes() {}
254253

255254
SymbolFileDWARFDebugMap::~SymbolFileDWARFDebugMap() = default;
256255

@@ -1157,22 +1156,6 @@ DWARFDIE SymbolFileDWARFDebugMap::FindDefinitionDIE(const DWARFDIE &die) {
11571156
return result;
11581157
}
11591158

1160-
bool SymbolFileDWARFDebugMap::Supports_DW_AT_APPLE_objc_complete_type(
1161-
SymbolFileDWARF *skip_dwarf_oso) {
1162-
if (m_supports_DW_AT_APPLE_objc_complete_type == eLazyBoolCalculate) {
1163-
m_supports_DW_AT_APPLE_objc_complete_type = eLazyBoolNo;
1164-
ForEachSymbolFile([&](SymbolFileDWARF *oso_dwarf) {
1165-
if (skip_dwarf_oso != oso_dwarf &&
1166-
oso_dwarf->Supports_DW_AT_APPLE_objc_complete_type(nullptr)) {
1167-
m_supports_DW_AT_APPLE_objc_complete_type = eLazyBoolYes;
1168-
return IterationAction::Stop;
1169-
}
1170-
return IterationAction::Continue;
1171-
});
1172-
}
1173-
return m_supports_DW_AT_APPLE_objc_complete_type == eLazyBoolYes;
1174-
}
1175-
11761159
TypeSP SymbolFileDWARFDebugMap::FindCompleteObjCDefinitionTypeForDIE(
11771160
const DWARFDIE &die, ConstString type_name,
11781161
bool must_be_implementation) {

lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -279,8 +279,6 @@ class SymbolFileDWARFDebugMap : public SymbolFileCommon {
279279

280280
DWARFDIE FindDefinitionDIE(const DWARFDIE &die);
281281

282-
bool Supports_DW_AT_APPLE_objc_complete_type(SymbolFileDWARF *skip_dwarf_oso);
283-
284282
lldb::TypeSP FindCompleteObjCDefinitionTypeForDIE(
285283
const DWARFDIE &die, ConstString type_name, bool must_be_implementation);
286284

@@ -331,7 +329,6 @@ class SymbolFileDWARFDebugMap : public SymbolFileCommon {
331329
llvm::DenseMap<lldb::opaque_compiler_type_t, DIERef>
332330
m_forward_decl_compiler_type_to_die;
333331
UniqueDWARFASTTypeMap m_unique_ast_type_map;
334-
LazyBool m_supports_DW_AT_APPLE_objc_complete_type;
335332
DebugMap m_debug_map;
336333

337334
// When an object file from the debug map gets parsed in

0 commit comments

Comments
 (0)