Author: friss Date: Thu Jun 21 17:22:50 2018 New Revision: 335313 URL: http://llvm.org/viewvc/llvm-project?rev=335313&view=rev Log: Remove dead code
Our DWARF parsing code had a workaorund for Objective-C "self" not being marked as artifial by the compiler. Clang has been doing this since 2010, so let's just drop the workaround. Modified: lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp Modified: lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp?rev=335313&r1=335312&r2=335313&view=diff ============================================================================== --- lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp (original) +++ lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp Thu Jun 21 17:22:50 2018 @@ -3486,51 +3486,29 @@ size_t DWARFASTParserClang::ParseChildPa } bool skip = false; - if (skip_artificial) { - if (is_artificial) { - // In order to determine if a C++ member function is "const" we - // have to look at the const-ness of "this"... Ugly, but that - if (arg_idx == 0) { - if (DeclKindIsCXXClass(containing_decl_ctx->getDeclKind())) { - // Often times compilers omit the "this" name for the - // specification DIEs, so we can't rely upon the name being in - // the formal parameter DIE... - if (name == NULL || ::strcmp(name, "this") == 0) { - Type *this_type = - die.ResolveTypeUID(DIERef(param_type_die_form)); - if (this_type) { - uint32_t encoding_mask = this_type->GetEncodingMask(); - if (encoding_mask & Type::eEncodingIsPointerUID) { - is_static = false; + if (skip_artificial && is_artificial) { + // In order to determine if a C++ member function is "const" we + // have to look at the const-ness of "this"... + if (arg_idx == 0 && + DeclKindIsCXXClass(containing_decl_ctx->getDeclKind()) && + // Often times compilers omit the "this" name for the + // specification DIEs, so we can't rely upon the name being in + // the formal parameter DIE... + (name == NULL || ::strcmp(name, "this") == 0)) { + Type *this_type = die.ResolveTypeUID(DIERef(param_type_die_form)); + if (this_type) { + uint32_t encoding_mask = this_type->GetEncodingMask(); + if (encoding_mask & Type::eEncodingIsPointerUID) { + is_static = false; - if (encoding_mask & (1u << Type::eEncodingIsConstUID)) - type_quals |= clang::Qualifiers::Const; - if (encoding_mask & (1u << Type::eEncodingIsVolatileUID)) - type_quals |= clang::Qualifiers::Volatile; - } - } - } - } - } - skip = true; - } else { - - // HACK: Objective-C formal parameters "self" and "_cmd" - // are not marked as artificial in the DWARF... - CompileUnit *comp_unit = die.GetLLDBCompileUnit(); - if (comp_unit) { - switch (comp_unit->GetLanguage()) { - case eLanguageTypeObjC: - case eLanguageTypeObjC_plus_plus: - if (name && name[0] && - (strcmp(name, "self") == 0 || strcmp(name, "_cmd") == 0)) - skip = true; - break; - default: - break; + if (encoding_mask & (1u << Type::eEncodingIsConstUID)) + type_quals |= clang::Qualifiers::Const; + if (encoding_mask & (1u << Type::eEncodingIsVolatileUID)) + type_quals |= clang::Qualifiers::Volatile; } } } + skip = true; } if (!skip) { _______________________________________________ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits