Skip to content

Commit f6bbbcc

Browse files
committed
[lldb][DWARFASTParserClang][ObjC] Remove workaround for old ObjC DWARF (llvm#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. (cherry picked from commit 794cd81)
1 parent dd0f3b2 commit f6bbbcc

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
@@ -1810,20 +1810,6 @@ DWARFASTParserClang::ParseStructureLikeDIE(const SymbolContext &sc,
18101810
ConstString unique_typename(attrs.name);
18111811
Declaration unique_decl(attrs.decl);
18121812
uint64_t byte_size = attrs.byte_size.value_or(0);
1813-
if (attrs.byte_size && *attrs.byte_size == 0 && attrs.name &&
1814-
!die.HasChildren() && cu_language == eLanguageTypeObjC) {
1815-
// Work around an issue with clang at the moment where forward
1816-
// declarations for objective C classes are emitted as:
1817-
// DW_TAG_structure_type [2]
1818-
// DW_AT_name( "ForwardObjcClass" )
1819-
// DW_AT_byte_size( 0x00 )
1820-
// DW_AT_decl_file( "..." )
1821-
// DW_AT_decl_line( 1 )
1822-
//
1823-
// Note that there is no DW_AT_declaration and there are no children,
1824-
// and the byte size is zero.
1825-
attrs.is_forward_declaration = true;
1826-
}
18271813

18281814
if (attrs.name) {
18291815
GetUniqueTypeNameAndDeclaration(die, cu_language, unique_typename,

0 commit comments

Comments
 (0)