Skip to content

Commit 02b775a

Browse files
jankratochviltstellar
authored andcommitted
[nfc] llvm-dwarfdump: DWARFAbbreviationDeclaration::AttributeSpec -> DWARFAttribute
`AttributeSpec` does not contain values while `DWARFAttribute` already does. Therefore one no longer needs to pass `uint64_t *OffsetPtr`. Differential Revision: https://reviews.llvm.org/D98194 (cherry picked from commit ba8907b)
1 parent edd770b commit 02b775a

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

llvm/lib/DebugInfo/DWARF/DWARFDie.cpp

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ static void dumpRanges(const DWARFObject &Obj, raw_ostream &OS,
6969
}
7070
}
7171

72-
static void dumpLocation(raw_ostream &OS, DWARFFormValue &FormValue,
72+
static void dumpLocation(raw_ostream &OS, const DWARFFormValue &FormValue,
7373
DWARFUnit *U, unsigned Indent,
7474
DIDumpOptions DumpOpts) {
7575
DWARFContext &Ctx = U->getContext();
@@ -230,21 +230,22 @@ static void dumpTypeName(raw_ostream &OS, const DWARFDie &D) {
230230
}
231231

232232
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,
235234
DIDumpOptions DumpOpts) {
236235
if (!Die.isValid())
237236
return;
238237
const char BaseIndent[] = " ";
239238
OS << BaseIndent;
240239
OS.indent(Indent + 2);
240+
dwarf::Attribute Attr = AttrValue.Attr;
241241
WithColor(OS, HighlightColor::Attribute) << formatv("{0}", Attr);
242242

243+
dwarf::Form Form = AttrValue.Value.getForm();
243244
if (DumpOpts.Verbose || DumpOpts.ShowForm)
244245
OS << formatv(" [{0}]", Form);
245246

246247
DWARFUnit *U = Die.getDwarfUnit();
247-
DWARFFormValue FormValue = DWARFFormValue::createFromUnit(Form, U, OffsetPtr);
248+
const DWARFFormValue &FormValue = AttrValue.Value;
248249

249250
OS << "\t(";
250251

@@ -631,15 +632,14 @@ void DWARFDie::dump(raw_ostream &OS, unsigned Indent,
631632
OS << '\n';
632633

633634
// 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) {
636637
// We are dumping .debug_info section ,
637638
// implicit_const attribute values are not really stored here,
638639
// but in .debug_abbrev section. So we just skip such attrs.
639640
continue;
640641
}
641-
dumpAttribute(OS, *this, &offset, AttrSpec.Attr, AttrSpec.Form,
642-
Indent, DumpOpts);
642+
dumpAttribute(OS, *this, AttrValue, Indent, DumpOpts);
643643
}
644644

645645
DWARFDie child = getFirstChild();

0 commit comments

Comments
 (0)