summaryrefslogtreecommitdiffstats
path: root/llvm/lib/DebugInfo/DWARFUnit.cpp
diff options
context:
space:
mode:
authorAlexey Samsonov <samsonov@google.com>2013-10-28 23:01:48 +0000
committerAlexey Samsonov <samsonov@google.com>2013-10-28 23:01:48 +0000
commit48cbda5850264671e982ecdd834c1587b1732c15 (patch)
treefceb336b9978d09dbaa90b78b3ee5028c40e6b19 /llvm/lib/DebugInfo/DWARFUnit.cpp
parent0a09ebf445339748b549d7c8743fcb7e435d3527 (diff)
downloadbcm5719-llvm-48cbda5850264671e982ecdd834c1587b1732c15.tar.gz
bcm5719-llvm-48cbda5850264671e982ecdd834c1587b1732c15.zip
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
Diffstat (limited to 'llvm/lib/DebugInfo/DWARFUnit.cpp')
-rw-r--r--llvm/lib/DebugInfo/DWARFUnit.cpp16
1 files changed, 8 insertions, 8 deletions
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();
OpenPOWER on IntegriCloud