diff options
Diffstat (limited to 'lib/DebugInfo/DWARF/DWARFAbbreviationDeclaration.cpp')
-rw-r--r-- | lib/DebugInfo/DWARF/DWARFAbbreviationDeclaration.cpp | 26 |
1 files changed, 5 insertions, 21 deletions
diff --git a/lib/DebugInfo/DWARF/DWARFAbbreviationDeclaration.cpp b/lib/DebugInfo/DWARF/DWARFAbbreviationDeclaration.cpp index f593953c62ff..adada672af00 100644 --- a/lib/DebugInfo/DWARF/DWARFAbbreviationDeclaration.cpp +++ b/lib/DebugInfo/DWARF/DWARFAbbreviationDeclaration.cpp @@ -16,6 +16,7 @@ #include "llvm/DebugInfo/DWARF/DWARFUnit.h" #include "llvm/Support/DataExtractor.h" #include "llvm/Support/Format.h" +#include "llvm/Support/FormatVariadic.h" #include "llvm/Support/raw_ostream.h" #include <cstddef> #include <cstdint> @@ -96,8 +97,7 @@ DWARFAbbreviationDeclaration::extract(DataExtractor Data, default: // The form has a byte size that doesn't depend on Params. // If it's a fixed size, keep track of it. - if ((ByteSize = - DWARFFormValue::getFixedByteSize(F, DWARFFormParams()))) { + if ((ByteSize = dwarf::getFixedFormByteSize(F, dwarf::FormParams()))) { if (FixedAttributeSize) FixedAttributeSize->NumBytes += *ByteSize; break; @@ -127,26 +127,11 @@ DWARFAbbreviationDeclaration::extract(DataExtractor Data, } void DWARFAbbreviationDeclaration::dump(raw_ostream &OS) const { - auto tagString = TagString(getTag()); OS << '[' << getCode() << "] "; - if (!tagString.empty()) - OS << tagString; - else - OS << format("DW_TAG_Unknown_%x", getTag()); + OS << formatv("{0}", getTag()); OS << "\tDW_CHILDREN_" << (hasChildren() ? "yes" : "no") << '\n'; for (const AttributeSpec &Spec : AttributeSpecs) { - OS << '\t'; - auto attrString = AttributeString(Spec.Attr); - if (!attrString.empty()) - OS << attrString; - else - OS << format("DW_AT_Unknown_%x", Spec.Attr); - OS << '\t'; - auto formString = FormEncodingString(Spec.Form); - if (!formString.empty()) - OS << formString; - else - OS << format("DW_FORM_Unknown_%x", Spec.Form); + OS << formatv("\t{0}\t{1}", Spec.Attr, Spec.Form); if (Spec.isImplicitConst()) OS << '\t' << Spec.getImplicitConstValue(); OS << '\n'; @@ -217,8 +202,7 @@ Optional<int64_t> DWARFAbbreviationDeclaration::AttributeSpec::getByteSize( if (ByteSize.HasByteSize) return ByteSize.ByteSize; Optional<int64_t> S; - auto FixedByteSize = - DWARFFormValue::getFixedByteSize(Form, U.getFormParams()); + auto FixedByteSize = dwarf::getFixedFormByteSize(Form, U.getFormParams()); if (FixedByteSize) S = *FixedByteSize; return S; |