diff options
author | Greg Clayton <gclayton@apple.com> | 2016-10-27 16:32:04 +0000 |
---|---|---|
committer | Greg Clayton <gclayton@apple.com> | 2016-10-27 16:32:04 +0000 |
commit | 6c273763a366de3b1e22348b638795795fb7e005 (patch) | |
tree | 5c0f236f8478957ccee8c081427a6fa2b497aff2 /llvm/lib/DebugInfo/DWARF/DWARFDebugInfoEntry.cpp | |
parent | b94c09baa058e57b1e931746745050e19785ef30 (diff) | |
download | bcm5719-llvm-6c273763a366de3b1e22348b638795795fb7e005.tar.gz bcm5719-llvm-6c273763a366de3b1e22348b638795795fb7e005.zip |
Switch all DWARF variables for tags, attributes and forms over to use the llvm::dwarf enumerations instead of using raw uint16_t values. This allows easier debugging as users can see the values of the enumerations in the variables view that will show the enumeration string instead of just a number.
https://reviews.llvm.org/D26013
llvm-svn: 285309
Diffstat (limited to 'llvm/lib/DebugInfo/DWARF/DWARFDebugInfoEntry.cpp')
-rw-r--r-- | llvm/lib/DebugInfo/DWARF/DWARFDebugInfoEntry.cpp | 24 |
1 files changed, 15 insertions, 9 deletions
diff --git a/llvm/lib/DebugInfo/DWARF/DWARFDebugInfoEntry.cpp b/llvm/lib/DebugInfo/DWARF/DWARFDebugInfoEntry.cpp index c43456b1c57..e4577dc12c2 100644 --- a/llvm/lib/DebugInfo/DWARF/DWARFDebugInfoEntry.cpp +++ b/llvm/lib/DebugInfo/DWARF/DWARFDebugInfoEntry.cpp @@ -112,7 +112,8 @@ static void dumpRanges(raw_ostream &OS, const DWARFAddressRangesVector& Ranges, void DWARFDebugInfoEntryMinimal::dumpAttribute(raw_ostream &OS, DWARFUnit *u, uint32_t *offset_ptr, - uint16_t attr, uint16_t form, + dwarf::Attribute attr, + dwarf::Form form, unsigned indent) const { const char BaseIndent[] = " "; OS << BaseIndent; @@ -207,7 +208,7 @@ bool DWARFDebugInfoEntryMinimal::extractFast(const DWARFUnit *U, // Skip all data in the .debug_info for the attributes for (const auto &AttrSpec : AbbrevDecl->attributes()) { - uint16_t Form = AttrSpec.Form; + auto Form = AttrSpec.Form; uint8_t FixedFormSize = (Form < FixedFormSizes.size()) ? FixedFormSizes[Form] : 0; @@ -232,8 +233,8 @@ bool DWARFDebugInfoEntryMinimal::isSubroutineDIE() const { Tag == DW_TAG_inlined_subroutine; } -bool DWARFDebugInfoEntryMinimal::getAttributeValue( - const DWARFUnit *U, const uint16_t Attr, DWARFFormValue &FormValue) const { +bool DWARFDebugInfoEntryMinimal::getAttributeValue(const DWARFUnit *U, + dwarf::Attribute Attr, DWARFFormValue &FormValue) const { if (!AbbrevDecl) return false; @@ -258,7 +259,8 @@ bool DWARFDebugInfoEntryMinimal::getAttributeValue( } const char *DWARFDebugInfoEntryMinimal::getAttributeValueAsString( - const DWARFUnit *U, const uint16_t Attr, const char *FailValue) const { + const DWARFUnit *U, dwarf::Attribute Attr, + const char *FailValue) const { DWARFFormValue FormValue; if (!getAttributeValue(U, Attr, FormValue)) return FailValue; @@ -267,7 +269,8 @@ const char *DWARFDebugInfoEntryMinimal::getAttributeValueAsString( } uint64_t DWARFDebugInfoEntryMinimal::getAttributeValueAsAddress( - const DWARFUnit *U, const uint16_t Attr, uint64_t FailValue) const { + const DWARFUnit *U, dwarf::Attribute Attr, + uint64_t FailValue) const { DWARFFormValue FormValue; if (!getAttributeValue(U, Attr, FormValue)) return FailValue; @@ -276,7 +279,8 @@ uint64_t DWARFDebugInfoEntryMinimal::getAttributeValueAsAddress( } uint64_t DWARFDebugInfoEntryMinimal::getAttributeValueAsUnsignedConstant( - const DWARFUnit *U, const uint16_t Attr, uint64_t FailValue) const { + const DWARFUnit *U, dwarf::Attribute Attr, + uint64_t FailValue) const { DWARFFormValue FormValue; if (!getAttributeValue(U, Attr, FormValue)) return FailValue; @@ -285,7 +289,8 @@ uint64_t DWARFDebugInfoEntryMinimal::getAttributeValueAsUnsignedConstant( } uint64_t DWARFDebugInfoEntryMinimal::getAttributeValueAsReference( - const DWARFUnit *U, const uint16_t Attr, uint64_t FailValue) const { + const DWARFUnit *U, dwarf::Attribute Attr, + uint64_t FailValue) const { DWARFFormValue FormValue; if (!getAttributeValue(U, Attr, FormValue)) return FailValue; @@ -294,7 +299,8 @@ uint64_t DWARFDebugInfoEntryMinimal::getAttributeValueAsReference( } uint64_t DWARFDebugInfoEntryMinimal::getAttributeValueAsSectionOffset( - const DWARFUnit *U, const uint16_t Attr, uint64_t FailValue) const { + const DWARFUnit *U, dwarf::Attribute Attr, + uint64_t FailValue) const { DWARFFormValue FormValue; if (!getAttributeValue(U, Attr, FormValue)) return FailValue; |