diff options
| author | Greg Clayton <gclayton@apple.com> | 2011-11-30 02:48:28 +0000 |
|---|---|---|
| committer | Greg Clayton <gclayton@apple.com> | 2011-11-30 02:48:28 +0000 |
| commit | 3a5f29a073186c27f3af3823b16806ca30053dbc (patch) | |
| tree | 9df26cf3b39e44a37c337f412f2dc4084c650a2e | |
| parent | 385d9f6c244d3eaef1a80174ed40cd402129bc75 (diff) | |
| download | bcm5719-llvm-3a5f29a073186c27f3af3823b16806ca30053dbc.tar.gz bcm5719-llvm-3a5f29a073186c27f3af3823b16806ca30053dbc.zip | |
Add a work around to deal with incorrect forward class definitions in
objective C DWARF emitted by clang.
llvm-svn: 145471
| -rw-r--r-- | lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp b/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp index e5a52d659c4..60ef0c8cf18 100644 --- a/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp +++ b/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp @@ -4156,6 +4156,24 @@ SymbolFileDWARF::ParseType (const SymbolContext& sc, DWARFCompileUnit* dwarf_cu, tag_decl_kind = clang::TTK_Class; default_accessibility = eAccessPrivate; } + + if (byte_size_valid && byte_size == 0 && type_name_cstr && + die->HasChildren() == false && + sc.comp_unit->GetLanguage() == eLanguageTypeObjC) + { + // Work around an issue with clang at the moment where + // forward declarations for objective C classes are emitted + // as: + // DW_TAG_structure_type [2] + // DW_AT_name( "ForwardObjcClass" ) + // DW_AT_byte_size( 0x00 ) + // DW_AT_decl_file( "..." ) + // DW_AT_decl_line( 1 ) + // + // Note that there is no DW_AT_declaration and there are + // no children, and the byte size is zero. + is_forward_declaration = true; + } bool look_for_complete_objc_type = false; if (class_language == eLanguageTypeObjC) |

