diff options
author | Eric Liu <ioeric@google.com> | 2018-12-17 14:14:40 +0000 |
---|---|---|
committer | Eric Liu <ioeric@google.com> | 2018-12-17 14:14:40 +0000 |
commit | 6c933a2bed30be7009b1994d112e188343d40265 (patch) | |
tree | 6f7194ff0beec7ee8431f46f31d8374894cc1965 /llvm/lib/DebugInfo | |
parent | 450606759351dabe1b975e3b48be80db9030c51a (diff) | |
download | bcm5719-llvm-6c933a2bed30be7009b1994d112e188343d40265.tar.gz bcm5719-llvm-6c933a2bed30be7009b1994d112e188343d40265.zip |
Revert "DebugInfo: Assume an absence of ranges or high_pc on a CU means the CU is empty (devoid of code addresses)"
This reverts commit r349333. It caused internal test to fail. I have
sent more information to the author.
llvm-svn: 349353
Diffstat (limited to 'llvm/lib/DebugInfo')
-rw-r--r-- | llvm/lib/DebugInfo/DWARF/DWARFUnit.cpp | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/llvm/lib/DebugInfo/DWARF/DWARFUnit.cpp b/llvm/lib/DebugInfo/DWARF/DWARFUnit.cpp index 569512cb8f0..48900e4b7a2 100644 --- a/llvm/lib/DebugInfo/DWARF/DWARFUnit.cpp +++ b/llvm/lib/DebugInfo/DWARF/DWARFUnit.cpp @@ -581,6 +581,27 @@ void DWARFUnit::collectAddressRanges(DWARFAddressRangesVector &CURanges) { } else WithColor::error() << "decoding address ranges: " << toString(CUDIERangesOrError.takeError()) << '\n'; + + // This function is usually called if there in no .debug_aranges section + // in order to produce a compile unit level set of address ranges that + // is accurate. If the DIEs weren't parsed, then we don't want all dies for + // all compile units to stay loaded when they weren't needed. So we can end + // up parsing the DWARF and then throwing them all away to keep memory usage + // down. + const bool ClearDIEs = extractDIEsIfNeeded(false) > 1; + getUnitDIE().collectChildrenAddressRanges(CURanges); + + // Collect address ranges from DIEs in .dwo if necessary. + bool DWOCreated = parseDWO(); + if (DWO) + DWO->collectAddressRanges(CURanges); + if (DWOCreated) + DWO.reset(); + + // Keep memory down by clearing DIEs if this generate function + // caused them to be parsed. + if (ClearDIEs) + clearDIEs(true); } void DWARFUnit::updateAddressDieMap(DWARFDie Die) { |