diff options
Diffstat (limited to 'llvm/lib/DebugInfo/DWARF/DWARFDie.cpp')
-rw-r--r-- | llvm/lib/DebugInfo/DWARF/DWARFDie.cpp | 26 |
1 files changed, 6 insertions, 20 deletions
diff --git a/llvm/lib/DebugInfo/DWARF/DWARFDie.cpp b/llvm/lib/DebugInfo/DWARF/DWARFDie.cpp index 82f373e9c5c..7ae38e6e053 100644 --- a/llvm/lib/DebugInfo/DWARF/DWARFDie.cpp +++ b/llvm/lib/DebugInfo/DWARF/DWARFDie.cpp @@ -21,6 +21,7 @@ #include "llvm/Object/ObjectFile.h" #include "llvm/Support/DataExtractor.h" #include "llvm/Support/Format.h" +#include "llvm/Support/FormatVariadic.h" #include "llvm/Support/MathExtras.h" #include "llvm/Support/WithColor.h" #include "llvm/Support/raw_ostream.h" @@ -188,20 +189,10 @@ static void dumpAttribute(raw_ostream &OS, const DWARFDie &Die, const char BaseIndent[] = " "; OS << BaseIndent; OS.indent(Indent + 2); - auto attrString = AttributeString(Attr); - if (!attrString.empty()) - WithColor(OS, HighlightColor::Attribute) << attrString; - else - WithColor(OS, HighlightColor::Attribute).get() - << format("DW_AT_Unknown_%x", Attr); + WithColor(OS, HighlightColor::Attribute) << formatv("{0}", Attr); - if (DumpOpts.Verbose || DumpOpts.ShowForm) { - auto formString = FormEncodingString(Form); - if (!formString.empty()) - OS << " [" << formString << ']'; - else - OS << format(" [DW_FORM_Unknown_%x]", Form); - } + if (DumpOpts.Verbose || DumpOpts.ShowForm) + OS << formatv(" [{0}]", Form); DWARFUnit *U = Die.getDwarfUnit(); DWARFFormValue formValue(Form); @@ -465,13 +456,8 @@ void DWARFDie::dump(raw_ostream &OS, unsigned Indent, if (abbrCode) { auto AbbrevDecl = getAbbreviationDeclarationPtr(); if (AbbrevDecl) { - auto tagString = TagString(getTag()); - if (!tagString.empty()) - WithColor(OS, HighlightColor::Tag).get().indent(Indent) << tagString; - else - WithColor(OS, HighlightColor::Tag).get().indent(Indent) - << format("DW_TAG_Unknown_%x", getTag()); - + WithColor(OS, HighlightColor::Tag).get().indent(Indent) + << formatv("{0}", getTag()); if (DumpOpts.Verbose) OS << format(" [%u] %c", abbrCode, AbbrevDecl->hasChildren() ? '*' : ' '); |