From 48cbda5850264671e982ecdd834c1587b1732c15 Mon Sep 17 00:00:00 2001 From: Alexey Samsonov Date: Mon, 28 Oct 2013 23:01:48 +0000 Subject: DebugInfo: Introduce the notion of "form classes" Summary: Use DWARF4 table of form classes to fetch attributes from DIE in a more consistent way. This shouldn't change the functionality and serves as a refactoring for upcoming change: DW_AT_high_pc has different semantics depending on its form class. Reviewers: dblaikie, echristo Reviewed By: echristo CC: echristo, llvm-commits Differential Revision: http://llvm-reviews.chandlerc.com/D1961 llvm-svn: 193553 --- llvm/lib/DebugInfo/DWARFUnit.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'llvm/lib/DebugInfo/DWARFUnit.cpp') diff --git a/llvm/lib/DebugInfo/DWARFUnit.cpp b/llvm/lib/DebugInfo/DWARFUnit.cpp index 770c65b433f..25062cd922a 100644 --- a/llvm/lib/DebugInfo/DWARFUnit.cpp +++ b/llvm/lib/DebugInfo/DWARFUnit.cpp @@ -144,7 +144,7 @@ uint64_t DWARFUnit::getDWOId() { if (DieArray.empty()) return FailValue; return DieArray[0] - .getAttributeValueAsUnsigned(this, DW_AT_GNU_dwo_id, FailValue); + .getAttributeValueAsUnsignedConstant(this, DW_AT_GNU_dwo_id, FailValue); } void DWARFUnit::setDIERelations() { @@ -251,14 +251,14 @@ size_t DWARFUnit::extractDIEsIfNeeded(bool CUDieOnly) { // If CU DIE was just parsed, copy several attribute values from it. if (!HasCUDie) { uint64_t BaseAddr = - DieArray[0].getAttributeValueAsUnsigned(this, DW_AT_low_pc, -1U); - if (BaseAddr == -1U) - BaseAddr = DieArray[0].getAttributeValueAsUnsigned(this, DW_AT_entry_pc, 0); + DieArray[0].getAttributeValueAsAddress(this, DW_AT_low_pc, -1ULL); + if (BaseAddr == -1ULL) + BaseAddr = DieArray[0].getAttributeValueAsAddress(this, DW_AT_entry_pc, 0); setBaseAddress(BaseAddr); - AddrOffsetSectionBase = - DieArray[0].getAttributeValueAsReference(this, DW_AT_GNU_addr_base, 0); - RangeSectionBase = - DieArray[0].getAttributeValueAsReference(this, DW_AT_GNU_ranges_base, 0); + AddrOffsetSectionBase = DieArray[0].getAttributeValueAsSectionOffset( + this, DW_AT_GNU_addr_base, 0); + RangeSectionBase = DieArray[0].getAttributeValueAsSectionOffset( + this, DW_AT_GNU_ranges_base, 0); } setDIERelations(); -- cgit v1.2.3