@@ -445,15 +445,6 @@ ParsedDWARFTypeAttributes::ParsedDWARFTypeAttributes(const DWARFDIE &die) {
445
445
name.SetCString (form_value.AsCString ());
446
446
break ;
447
447
448
- case DW_AT_object_pointer:
449
- // GetAttributes follows DW_AT_specification.
450
- // DW_TAG_subprogram definitions and declarations may both
451
- // have a DW_AT_object_pointer. Don't overwrite the one
452
- // we parsed for the definition with the one from the declaration.
453
- if (!object_pointer.IsValid ())
454
- object_pointer = form_value.Reference ();
455
- break ;
456
-
457
448
case DW_AT_signature:
458
449
signature = form_value;
459
450
break ;
@@ -1116,7 +1107,7 @@ bool DWARFASTParserClang::ParseObjCMethod(
1116
1107
std::pair<bool , TypeSP> DWARFASTParserClang::ParseCXXMethod (
1117
1108
const DWARFDIE &die, CompilerType clang_type,
1118
1109
const ParsedDWARFTypeAttributes &attrs, const DWARFDIE &decl_ctx_die,
1119
- bool is_static , bool &ignore_containing_context) {
1110
+ const DWARFDIE &object_parameter , bool &ignore_containing_context) {
1120
1111
Log *log = GetLog (DWARFLog::TypeCompletion | DWARFLog::Lookups);
1121
1112
SymbolFileDWARF *dwarf = die.GetDWARF ();
1122
1113
assert (dwarf);
@@ -1200,6 +1191,9 @@ std::pair<bool, TypeSP> DWARFASTParserClang::ParseCXXMethod(
1200
1191
TypeSystemClang::GetDeclContextForType (class_opaque_type), die,
1201
1192
attrs.name .GetCString ());
1202
1193
1194
+ // In DWARF, a C++ method is static if it has no object parameter child.
1195
+ const bool is_static = !object_parameter.IsValid ();
1196
+
1203
1197
// We have a C++ member function with no children (this pointer!) and clang
1204
1198
// will get mad if we try and make a function that isn't well formed in the
1205
1199
// DWARF, so we will just skip it...
@@ -1225,9 +1219,7 @@ std::pair<bool, TypeSP> DWARFASTParserClang::ParseCXXMethod(
1225
1219
ClangASTMetadata metadata;
1226
1220
metadata.SetUserID (die.GetID ());
1227
1221
1228
- char const *object_pointer_name =
1229
- attrs.object_pointer ? attrs.object_pointer .GetName () : nullptr ;
1230
- if (object_pointer_name) {
1222
+ if (char const *object_pointer_name = object_parameter.GetName ()) {
1231
1223
metadata.SetObjectPtrName (object_pointer_name);
1232
1224
LLDB_LOGF (log, " Setting object pointer name: %s on method object %p.\n " ,
1233
1225
object_pointer_name, static_cast <void *>(cxx_method_decl));
@@ -1323,11 +1315,9 @@ DWARFASTParserClang::ParseSubroutine(const DWARFDIE &die,
1323
1315
type_handled =
1324
1316
ParseObjCMethod (*objc_method, die, clang_type, attrs, is_variadic);
1325
1317
} else if (is_cxx_method) {
1326
- // In DWARF, a C++ method is static if it has no object parameter child.
1327
- const bool is_static = !object_parameter.IsValid ();
1328
1318
auto [handled, type_sp] =
1329
- ParseCXXMethod (die, clang_type, attrs, decl_ctx_die, is_static,
1330
- ignore_containing_context);
1319
+ ParseCXXMethod (die, clang_type, attrs, decl_ctx_die,
1320
+ object_parameter, ignore_containing_context);
1331
1321
if (type_sp)
1332
1322
return type_sp;
1333
1323
@@ -1422,9 +1412,7 @@ DWARFASTParserClang::ParseSubroutine(const DWARFDIE &die,
1422
1412
ClangASTMetadata metadata;
1423
1413
metadata.SetUserID (die.GetID ());
1424
1414
1425
- char const *object_pointer_name =
1426
- attrs.object_pointer ? attrs.object_pointer .GetName () : nullptr ;
1427
- if (object_pointer_name) {
1415
+ if (char const *object_pointer_name = object_parameter.GetName ()) {
1428
1416
metadata.SetObjectPtrName (object_pointer_name);
1429
1417
LLDB_LOGF (log,
1430
1418
" Setting object pointer name: %s on function "
0 commit comments