@@ -348,7 +348,7 @@ TypeSP DWARFASTParserClang::ParseTypeFromDWARF(const SymbolContext &sc,
348348 // will have a hard time tracking down an unnammed structure type in
349349 // the module DWO file, so we make sure we don't get into this
350350 // situation by always resolving typedefs from the DWO file.
351- const DWARFDIE encoding_die = dwarf-> GetDIE ( DIERef ( encoding_uid) );
351+ const DWARFDIE encoding_die = encoding_uid. Reference ( );
352352
353353 // First make sure that the die that this is typedef'ed to _is_ just
354354 // a declaration (DW_AT_declaration == 1), not a full definition
@@ -499,7 +499,7 @@ TypeSP DWARFASTParserClang::ParseTypeFromDWARF(const SymbolContext &sc,
499499 // Clang sometimes erroneously emits id as objc_object*. In that
500500 // case we fix up the type to "id".
501501
502- const DWARFDIE encoding_die = dwarf-> GetDIE ( DIERef ( encoding_uid) );
502+ const DWARFDIE encoding_die = encoding_uid. Reference ( );
503503
504504 if (encoding_die && encoding_die.Tag () == DW_TAG_structure_type) {
505505 if (const char *struct_name = encoding_die.GetName ()) {
@@ -1150,7 +1150,7 @@ TypeSP DWARFASTParserClang::ParseTypeFromDWARF(const SymbolContext &sc,
11501150 bool has_template_params = false ;
11511151 DWARFFormValue specification_die_form;
11521152 DWARFFormValue abstract_origin_die_form;
1153- dw_offset_t object_pointer_die_offset = DW_INVALID_OFFSET ;
1153+ DWARFDIE object_pointer_die ;
11541154
11551155 unsigned type_quals = 0 ;
11561156 clang::StorageClass storage =
@@ -1221,7 +1221,7 @@ TypeSP DWARFASTParserClang::ParseTypeFromDWARF(const SymbolContext &sc,
12211221 break ;
12221222
12231223 case DW_AT_object_pointer:
1224- object_pointer_die_offset = form_value.Reference ();
1224+ object_pointer_die = form_value.Reference ();
12251225 break ;
12261226
12271227 case DW_AT_allocated:
@@ -1254,13 +1254,10 @@ TypeSP DWARFASTParserClang::ParseTypeFromDWARF(const SymbolContext &sc,
12541254 }
12551255
12561256 std::string object_pointer_name;
1257- if (object_pointer_die_offset != DW_INVALID_OFFSET) {
1258- DWARFDIE object_pointer_die = die.GetDIE (object_pointer_die_offset);
1259- if (object_pointer_die) {
1260- const char *object_pointer_name_cstr = object_pointer_die.GetName ();
1261- if (object_pointer_name_cstr)
1262- object_pointer_name = object_pointer_name_cstr;
1263- }
1257+ if (object_pointer_die) {
1258+ const char *object_pointer_name_cstr = object_pointer_die.GetName ();
1259+ if (object_pointer_name_cstr)
1260+ object_pointer_name = object_pointer_name_cstr;
12641261 }
12651262
12661263 DEBUG_PRINTF (" 0x%8.8" PRIx64 " : %s (\" %s\" )\n " , die.GetID (),
@@ -1422,9 +1419,10 @@ TypeSP DWARFASTParserClang::ParseTypeFromDWARF(const SymbolContext &sc,
14221419 LinkDeclContextToDIE (spec_clang_decl_ctx, die);
14231420 } else {
14241421 dwarf->GetObjectFile ()->GetModule ()->ReportWarning (
1425- " 0x%8.8" PRIx64 " : DW_AT_specification(0x%8.8 " PRIx64
1422+ " 0x%8.8" PRIx64 " : DW_AT_specification(0x%8.8x "
14261423 " ) has no decl\n " ,
1427- die.GetID (), specification_die_form.Reference ());
1424+ die.GetID (),
1425+ specification_die_form.Reference ().GetOffset ());
14281426 }
14291427 type_handled = true ;
14301428 } else if (abstract_origin_die_form.IsValid ()) {
@@ -1442,9 +1440,10 @@ TypeSP DWARFASTParserClang::ParseTypeFromDWARF(const SymbolContext &sc,
14421440 LinkDeclContextToDIE (abs_clang_decl_ctx, die);
14431441 } else {
14441442 dwarf->GetObjectFile ()->GetModule ()->ReportWarning (
1445- " 0x%8.8" PRIx64 " : DW_AT_abstract_origin(0x%8.8 " PRIx64
1443+ " 0x%8.8" PRIx64 " : DW_AT_abstract_origin(0x%8.8x "
14461444 " ) has no decl\n " ,
1447- die.GetID (), abstract_origin_die_form.Reference ());
1445+ die.GetID (),
1446+ abstract_origin_die_form.Reference ().GetOffset ());
14481447 }
14491448 type_handled = true ;
14501449 } else {
@@ -1587,8 +1586,7 @@ TypeSP DWARFASTParserClang::ParseTypeFromDWARF(const SymbolContext &sc,
15871586 clang::FunctionDecl *template_function_decl = nullptr ;
15881587
15891588 if (abstract_origin_die_form.IsValid ()) {
1590- DWARFDIE abs_die =
1591- dwarf->DebugInfo ()->GetDIE (DIERef (abstract_origin_die_form));
1589+ DWARFDIE abs_die = abstract_origin_die_form.Reference ();
15921590
15931591 SymbolContext sc;
15941592
@@ -3070,9 +3068,10 @@ bool DWARFASTParserClang::ParseChildMembers(
30703068 member_byte_offset > parent_byte_size)) {
30713069 module_sp->ReportError (
30723070 " 0x%8.8" PRIx64
3073- " : DW_TAG_member '%s' refers to type 0x%8.8 " PRIx64
3071+ " : DW_TAG_member '%s' refers to type 0x%8.8x "
30743072 " which extends beyond the bounds of 0x%8.8" PRIx64,
3075- die.GetID (), name, encoding_form.Reference (),
3073+ die.GetID (), name,
3074+ encoding_form.Reference ().GetOffset (),
30763075 parent_die.GetID ());
30773076 }
30783077
@@ -3135,15 +3134,14 @@ bool DWARFASTParserClang::ParseChildMembers(
31353134 if (name)
31363135 module_sp->ReportError (
31373136 " 0x%8.8" PRIx64
3138- " : DW_TAG_member '%s' refers to type 0x%8.8 " PRIx64
3137+ " : DW_TAG_member '%s' refers to type 0x%8.8x "
31393138 " which was unable to be parsed" ,
3140- die.GetID (), name, encoding_form.Reference ());
3139+ die.GetID (), name, encoding_form.Reference (). GetOffset () );
31413140 else
31423141 module_sp->ReportError (
3143- " 0x%8.8" PRIx64
3144- " : DW_TAG_member refers to type 0x%8.8" PRIx64
3142+ " 0x%8.8" PRIx64 " : DW_TAG_member refers to type 0x%8.8x"
31453143 " which was unable to be parsed" ,
3146- die.GetID (), encoding_form.Reference ());
3144+ die.GetID (), encoding_form.Reference (). GetOffset () );
31473145 }
31483146 }
31493147
@@ -3253,11 +3251,12 @@ bool DWARFASTParserClang::ParseChildMembers(
32533251 Type *base_class_type = die.ResolveTypeUID (DIERef (encoding_form));
32543252 if (base_class_type == NULL ) {
32553253 module_sp->ReportError (" 0x%8.8x: DW_TAG_inheritance failed to "
3256- " resolve the base class at 0x%8.8 " PRIx64
3254+ " resolve the base class at 0x%8.8x "
32573255 " from enclosing type 0x%8.8x. \n Please file "
32583256 " a bug and attach the file at the start of "
32593257 " this error message" ,
3260- die.GetOffset (), encoding_form.Reference (),
3258+ die.GetOffset (),
3259+ encoding_form.Reference ().GetOffset (),
32613260 parent_die.GetOffset ());
32623261 break ;
32633262 }
@@ -3550,7 +3549,7 @@ Type *DWARFASTParserClang::GetTypeForDIE(const DWARFDIE &die) {
35503549
35513550 if (attr == DW_AT_type &&
35523551 attributes.ExtractFormValueAtIndex (i, form_value))
3553- return dwarf->ResolveTypeUID (dwarf-> GetDIE ( DIERef ( form_value) ), true );
3552+ return dwarf->ResolveTypeUID (form_value. Reference ( ), true );
35543553 }
35553554 }
35563555 }
0 commit comments