summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJan Kratochvil <jan.kratochvil@redhat.com>2021-03-09 08:31:23 +0100
committerTom Stellard <tstellar@redhat.com>2021-06-23 18:01:32 -0400
commit02b775a5efb6127e289bb00d91b88a303d51c85a (patch)
treea75263fa8de572440dc4739a7c67976dc9412a08
parentedd770b4bc99eb83dcf6ec1d2af92da42de2c575 (diff)
[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 ba8907bf6f2cf5ca2f6d92a6dfe7bc9cf74f003f)
-rw-r--r--llvm/lib/DebugInfo/DWARF/DWARFDie.cpp16
1 files changed, 8 insertions, 8 deletions
diff --git a/llvm/lib/DebugInfo/DWARF/DWARFDie.cpp b/llvm/lib/DebugInfo/DWARF/DWARFDie.cpp
index 427f6f4942c3..c2760dd02471 100644
--- a/llvm/lib/DebugInfo/DWARF/DWARFDie.cpp
+++ b/llvm/lib/DebugInfo/DWARF/DWARFDie.cpp
@@ -69,7 +69,7 @@ static void dumpRanges(const DWARFObject &Obj, raw_ostream &OS,
}
}
-static void dumpLocation(raw_ostream &OS, DWARFFormValue &FormValue,
+static void dumpLocation(raw_ostream &OS, const DWARFFormValue &FormValue,
DWARFUnit *U, unsigned Indent,
DIDumpOptions DumpOpts) {
DWARFContext &Ctx = U->getContext();
@@ -230,21 +230,22 @@ static void dumpTypeName(raw_ostream &OS, const DWARFDie &D) {
}
static void dumpAttribute(raw_ostream &OS, const DWARFDie &Die,
- uint64_t *OffsetPtr, dwarf::Attribute Attr,
- dwarf::Form Form, unsigned Indent,
+ const DWARFAttribute &AttrValue, unsigned Indent,
DIDumpOptions DumpOpts) {
if (!Die.isValid())
return;
const char BaseIndent[] = " ";
OS << BaseIndent;
OS.indent(Indent + 2);
+ dwarf::Attribute Attr = AttrValue.Attr;
WithColor(OS, HighlightColor::Attribute) << formatv("{0}", Attr);
+ dwarf::Form Form = AttrValue.Value.getForm();
if (DumpOpts.Verbose || DumpOpts.ShowForm)
OS << formatv(" [{0}]", Form);
DWARFUnit *U = Die.getDwarfUnit();
- DWARFFormValue FormValue = DWARFFormValue::createFromUnit(Form, U, OffsetPtr);
+ const DWARFFormValue &FormValue = AttrValue.Value;
OS << "\t(";
@@ -631,15 +632,14 @@ void DWARFDie::dump(raw_ostream &OS, unsigned Indent,
OS << '\n';
// Dump all data in the DIE for the attributes.
- for (const auto &AttrSpec : AbbrevDecl->attributes()) {
- if (AttrSpec.Form == DW_FORM_implicit_const) {
+ for (const DWARFAttribute &AttrValue : attributes()) {
+ if (AttrValue.Value.getForm() == DW_FORM_implicit_const) {
// We are dumping .debug_info section ,
// implicit_const attribute values are not really stored here,
// but in .debug_abbrev section. So we just skip such attrs.
continue;
}
- dumpAttribute(OS, *this, &offset, AttrSpec.Attr, AttrSpec.Form,
- Indent, DumpOpts);
+ dumpAttribute(OS, *this, AttrValue, Indent, DumpOpts);
}
DWARFDie child = getFirstChild();