Skip to content

Commit 0b10c37

Browse files
committed
[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. (cherry picked from commit f176388)
1 parent a47054e commit 0b10c37

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
@@ -1859,8 +1859,7 @@ DWARFASTParserClang::ParseStructureLikeDIE(const SymbolContext &sc,
18591859

18601860
if ((attrs.class_language == eLanguageTypeObjC ||
18611861
attrs.class_language == eLanguageTypeObjC_plus_plus) &&
1862-
!attrs.is_complete_objc_class &&
1863-
die.Supports_DW_AT_APPLE_objc_complete_type()) {
1862+
!attrs.is_complete_objc_class) {
18641863
// We have a valid eSymbolTypeObjCClass class symbol whose name
18651864
// matches the current objective C class that we are trying to find
18661865
// 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
@@ -734,10 +734,6 @@ bool DWARFUnit::LinkToSkeletonUnit(DWARFUnit &skeleton_unit) {
734734
return false; // Already linked to a different unit.
735735
}
736736

737-
bool DWARFUnit::Supports_DW_AT_APPLE_objc_complete_type() { return true; }
738-
739-
bool DWARFUnit::DW_AT_decl_file_attributes_are_invalid() { return false; }
740-
741737
bool DWARFUnit::Supports_unnamed_objc_bitfields() {
742738
if (GetProducer() == eProducerClang)
743739
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
@@ -171,10 +171,6 @@ class DWARFUnit : public UserID {
171171

172172
bool LinkToSkeletonUnit(DWARFUnit &skeleton_unit);
173173

174-
bool Supports_DW_AT_APPLE_objc_complete_type();
175-
176-
bool DW_AT_decl_file_attributes_are_invalid();
177-
178174
bool Supports_unnamed_objc_bitfields();
179175

180176
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

@@ -3072,37 +3071,6 @@ Symbol *SymbolFileDWARF::GetObjCClassSymbol(ConstString objc_class_name) {
30723071
return objc_class_symbol;
30733072
}
30743073

3075-
// Some compilers don't emit the DW_AT_APPLE_objc_complete_type attribute. If
3076-
// they don't then we can end up looking through all class types for a complete
3077-
// type and never find the full definition. We need to know if this attribute
3078-
// is supported, so we determine this here and cache th result. We also need to
3079-
// worry about the debug map
3080-
// DWARF file
3081-
// if we are doing darwin DWARF in .o file debugging.
3082-
bool SymbolFileDWARF::Supports_DW_AT_APPLE_objc_complete_type(DWARFUnit *cu) {
3083-
if (m_supports_DW_AT_APPLE_objc_complete_type == eLazyBoolCalculate) {
3084-
m_supports_DW_AT_APPLE_objc_complete_type = eLazyBoolNo;
3085-
if (cu && cu->Supports_DW_AT_APPLE_objc_complete_type())
3086-
m_supports_DW_AT_APPLE_objc_complete_type = eLazyBoolYes;
3087-
else {
3088-
DWARFDebugInfo &debug_info = DebugInfo();
3089-
const uint32_t num_compile_units = GetNumCompileUnits();
3090-
for (uint32_t cu_idx = 0; cu_idx < num_compile_units; ++cu_idx) {
3091-
DWARFUnit *dwarf_cu = debug_info.GetUnitAtIndex(cu_idx);
3092-
if (dwarf_cu != cu &&
3093-
dwarf_cu->Supports_DW_AT_APPLE_objc_complete_type()) {
3094-
m_supports_DW_AT_APPLE_objc_complete_type = eLazyBoolYes;
3095-
break;
3096-
}
3097-
}
3098-
}
3099-
if (m_supports_DW_AT_APPLE_objc_complete_type == eLazyBoolNo &&
3100-
GetDebugMapSymfile())
3101-
return m_debug_map_symfile->Supports_DW_AT_APPLE_objc_complete_type(this);
3102-
}
3103-
return m_supports_DW_AT_APPLE_objc_complete_type == eLazyBoolYes;
3104-
}
3105-
31063074
// This function can be used when a DIE is found that is a forward declaration
31073075
// DIE and we want to try and find a type that has the complete definition.
31083076
TypeSP SymbolFileDWARF::FindCompleteObjCDefinitionTypeForDIE(
@@ -3120,8 +3088,7 @@ TypeSP SymbolFileDWARF::FindCompleteObjCDefinitionTypeForDIE(
31203088
if (type_die == die || !IsStructOrClassTag(type_die.Tag()))
31213089
return true;
31223090

3123-
if (must_be_implementation &&
3124-
type_die.Supports_DW_AT_APPLE_objc_complete_type()) {
3091+
if (must_be_implementation) {
31253092
const bool try_resolving_type = type_die.GetAttributeValueAsUnsigned(
31263093
DW_AT_APPLE_objc_complete_type, 0);
31273094
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
@@ -246,8 +246,6 @@ class SymbolFileDWARF : public SymbolFileCommon {
246246
virtual void GetObjCMethods(ConstString class_name,
247247
llvm::function_ref<bool(DWARFDIE die)> callback);
248248

249-
bool Supports_DW_AT_APPLE_objc_complete_type(DWARFUnit *cu);
250-
251249
DebugMacrosSP ParseDebugMacros(lldb::offset_t *offset);
252250

253251
static DWARFDIE GetParentSymbolContextDIE(const DWARFDIE &die);
@@ -556,7 +554,6 @@ class SymbolFileDWARF : public SymbolFileCommon {
556554
ExternalTypeModuleMap m_external_type_modules;
557555
std::unique_ptr<DWARFIndex> m_index;
558556
bool m_fetched_external_modules : 1;
559-
LazyBool m_supports_DW_AT_APPLE_objc_complete_type;
560557

561558
typedef std::set<DIERef> DIERefSet;
562559
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
@@ -249,9 +249,8 @@ SymbolFile *SymbolFileDWARFDebugMap::CreateInstance(ObjectFileSP objfile_sp) {
249249
}
250250

251251
SymbolFileDWARFDebugMap::SymbolFileDWARFDebugMap(ObjectFileSP objfile_sp)
252-
: SymbolFileCommon(std::move(objfile_sp)), m_flags(), m_compile_unit_infos(),
253-
m_func_indexes(), m_glob_indexes(),
254-
m_supports_DW_AT_APPLE_objc_complete_type(eLazyBoolCalculate) {}
252+
: SymbolFileCommon(std::move(objfile_sp)), m_flags(),
253+
m_compile_unit_infos(), m_func_indexes(), m_glob_indexes() {}
255254

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

@@ -1178,22 +1177,6 @@ DWARFDIE SymbolFileDWARFDebugMap::FindDefinitionDIE(const DWARFDIE &die) {
11781177
return result;
11791178
}
11801179

1181-
bool SymbolFileDWARFDebugMap::Supports_DW_AT_APPLE_objc_complete_type(
1182-
SymbolFileDWARF *skip_dwarf_oso) {
1183-
if (m_supports_DW_AT_APPLE_objc_complete_type == eLazyBoolCalculate) {
1184-
m_supports_DW_AT_APPLE_objc_complete_type = eLazyBoolNo;
1185-
ForEachSymbolFile([&](SymbolFileDWARF *oso_dwarf) {
1186-
if (skip_dwarf_oso != oso_dwarf &&
1187-
oso_dwarf->Supports_DW_AT_APPLE_objc_complete_type(nullptr)) {
1188-
m_supports_DW_AT_APPLE_objc_complete_type = eLazyBoolYes;
1189-
return IterationAction::Stop;
1190-
}
1191-
return IterationAction::Continue;
1192-
});
1193-
}
1194-
return m_supports_DW_AT_APPLE_objc_complete_type == eLazyBoolYes;
1195-
}
1196-
11971180
TypeSP SymbolFileDWARFDebugMap::FindCompleteObjCDefinitionTypeForDIE(
11981181
const DWARFDIE &die, ConstString type_name,
11991182
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
@@ -293,8 +293,6 @@ class SymbolFileDWARFDebugMap : public SymbolFileCommon {
293293

294294
DWARFDIE FindDefinitionDIE(const DWARFDIE &die);
295295

296-
bool Supports_DW_AT_APPLE_objc_complete_type(SymbolFileDWARF *skip_dwarf_oso);
297-
298296
lldb::TypeSP FindCompleteObjCDefinitionTypeForDIE(
299297
const DWARFDIE &die, ConstString type_name, bool must_be_implementation);
300298

@@ -345,7 +343,6 @@ class SymbolFileDWARFDebugMap : public SymbolFileCommon {
345343
llvm::DenseMap<lldb::opaque_compiler_type_t, DIERef>
346344
m_forward_decl_compiler_type_to_die;
347345
UniqueDWARFASTTypeMap m_unique_ast_type_map;
348-
LazyBool m_supports_DW_AT_APPLE_objc_complete_type;
349346
DebugMap m_debug_map;
350347

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

0 commit comments

Comments
 (0)