diff options
-rw-r--r-- | lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp | 62 |
1 files changed, 20 insertions, 42 deletions
diff --git a/lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp b/lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp index 10028186636..fe6f1be3ca4 100644 --- a/lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp +++ b/lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp @@ -3486,51 +3486,29 @@ size_t DWARFASTParserClang::ParseChildParameters( } 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 (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 (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; } if (!skip) { |