summaryrefslogtreecommitdiffstats
path: root/llvm/lib/DebugInfo/DWARF/DWARFUnit.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib/DebugInfo/DWARF/DWARFUnit.cpp')
-rw-r--r--llvm/lib/DebugInfo/DWARF/DWARFUnit.cpp13
1 files changed, 7 insertions, 6 deletions
diff --git a/llvm/lib/DebugInfo/DWARF/DWARFUnit.cpp b/llvm/lib/DebugInfo/DWARF/DWARFUnit.cpp
index 0a12fb2ecaa..5b0b3f65f6c 100644
--- a/llvm/lib/DebugInfo/DWARF/DWARFUnit.cpp
+++ b/llvm/lib/DebugInfo/DWARF/DWARFUnit.cpp
@@ -245,12 +245,13 @@ size_t DWARFUnit::extractDIEsIfNeeded(bool CUDieOnly) {
auto BaseAddr = toAddress(UnitDie.find({DW_AT_low_pc, DW_AT_entry_pc}));
if (BaseAddr)
setBaseAddress(*BaseAddr);
- Optional<DWARFFormValue> AddrBase = UnitDie.find(DW_AT_GNU_addr_base);
- if (AddrBase)
- AddrOffsetSectionBase = *toSectionOffset(AddrBase);
- Optional<DWARFFormValue> RngListsBase = UnitDie.find(DW_AT_rnglists_base);
- if (RngListsBase)
- RangeSectionBase = *toSectionOffset(RngListsBase);
+ if (!isDWO) {
+ assert(AddrOffsetSectionBase == 0);
+ assert(RangeSectionBase == 0);
+ AddrOffsetSectionBase =
+ toSectionOffset(UnitDie.find(DW_AT_GNU_addr_base), 0);
+ RangeSectionBase = toSectionOffset(UnitDie.find(DW_AT_rnglists_base), 0);
+ }
// In general, we derive the offset of the unit's contibution to the
// debug_str_offsets{.dwo} section from the unit DIE's
OpenPOWER on IntegriCloud