Skip to content

Commit 794cd81

Browse files
authored
[lldb][DWARFASTParserClang][ObjC] Remove workaround for old ObjC DWARF (#120218)
With all the recent versions of Clang that I tested, ObjC forward declarations like ``` @Class ForwardObjcClass; ``` don't emit the kind of DWARF that this workaround was put in place for. Also, zero-sized structures are valid in C (and thus Objective-C), so this workaround makes things confusing to reason about when mixing the two languages. This workaround has been in place for at least a decade, and given that recent compilers don't produce this anymore, we think it's a good time to remove it.
1 parent 52b07d9 commit 794cd81

File tree

1 file changed

+0
-14
lines changed

1 file changed

+0
-14
lines changed

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

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1657,20 +1657,6 @@ DWARFASTParserClang::ParseStructureLikeDIE(const SymbolContext &sc,
16571657
ConstString unique_typename(attrs.name);
16581658
Declaration unique_decl(attrs.decl);
16591659
uint64_t byte_size = attrs.byte_size.value_or(0);
1660-
if (attrs.byte_size && *attrs.byte_size == 0 && attrs.name &&
1661-
!die.HasChildren() && cu_language == eLanguageTypeObjC) {
1662-
// Work around an issue with clang at the moment where forward
1663-
// declarations for objective C classes are emitted as:
1664-
// DW_TAG_structure_type [2]
1665-
// DW_AT_name( "ForwardObjcClass" )
1666-
// DW_AT_byte_size( 0x00 )
1667-
// DW_AT_decl_file( "..." )
1668-
// DW_AT_decl_line( 1 )
1669-
//
1670-
// Note that there is no DW_AT_declaration and there are no children,
1671-
// and the byte size is zero.
1672-
attrs.is_forward_declaration = true;
1673-
}
16741660

16751661
if (attrs.name) {
16761662
GetUniqueTypeNameAndDeclaration(die, cu_language, unique_typename,

0 commit comments

Comments
 (0)