@@ -69,7 +69,7 @@ static void dumpRanges(const DWARFObject &Obj, raw_ostream &OS,
69
69
}
70
70
}
71
71
72
- static void dumpLocation (raw_ostream &OS, DWARFFormValue &FormValue,
72
+ static void dumpLocation (raw_ostream &OS, const DWARFFormValue &FormValue,
73
73
DWARFUnit *U, unsigned Indent,
74
74
DIDumpOptions DumpOpts) {
75
75
DWARFContext &Ctx = U->getContext ();
@@ -230,21 +230,22 @@ static void dumpTypeName(raw_ostream &OS, const DWARFDie &D) {
230
230
}
231
231
232
232
static void dumpAttribute (raw_ostream &OS, const DWARFDie &Die,
233
- uint64_t *OffsetPtr, dwarf::Attribute Attr,
234
- dwarf::Form Form, unsigned Indent,
233
+ const DWARFAttribute &AttrValue, unsigned Indent,
235
234
DIDumpOptions DumpOpts) {
236
235
if (!Die.isValid ())
237
236
return ;
238
237
const char BaseIndent[] = " " ;
239
238
OS << BaseIndent;
240
239
OS.indent (Indent + 2 );
240
+ dwarf::Attribute Attr = AttrValue.Attr ;
241
241
WithColor (OS, HighlightColor::Attribute) << formatv (" {0}" , Attr);
242
242
243
+ dwarf::Form Form = AttrValue.Value .getForm ();
243
244
if (DumpOpts.Verbose || DumpOpts.ShowForm )
244
245
OS << formatv (" [{0}]" , Form);
245
246
246
247
DWARFUnit *U = Die.getDwarfUnit ();
247
- DWARFFormValue FormValue = DWARFFormValue::createFromUnit (Form, U, OffsetPtr) ;
248
+ const DWARFFormValue & FormValue = AttrValue. Value ;
248
249
249
250
OS << " \t (" ;
250
251
@@ -631,15 +632,14 @@ void DWARFDie::dump(raw_ostream &OS, unsigned Indent,
631
632
OS << ' \n ' ;
632
633
633
634
// Dump all data in the DIE for the attributes.
634
- for (const auto &AttrSpec : AbbrevDecl-> attributes ()) {
635
- if (AttrSpec. Form == DW_FORM_implicit_const) {
635
+ for (const DWARFAttribute &AttrValue : attributes ()) {
636
+ if (AttrValue. Value . getForm () == DW_FORM_implicit_const) {
636
637
// We are dumping .debug_info section ,
637
638
// implicit_const attribute values are not really stored here,
638
639
// but in .debug_abbrev section. So we just skip such attrs.
639
640
continue ;
640
641
}
641
- dumpAttribute (OS, *this , &offset, AttrSpec.Attr , AttrSpec.Form ,
642
- Indent, DumpOpts);
642
+ dumpAttribute (OS, *this , AttrValue, Indent, DumpOpts);
643
643
}
644
644
645
645
DWARFDie child = getFirstChild ();
0 commit comments