summaryrefslogtreecommitdiffstats
path: root/llvm/lib/DebugInfo/DWARF/DWARFContext.cpp
diff options
context:
space:
mode:
authorDavid Blaikie <dblaikie@gmail.com>2017-09-19 18:36:11 +0000
committerDavid Blaikie <dblaikie@gmail.com>2017-09-19 18:36:11 +0000
commite79dda31e9ed6cfc97d06ad87976fb16e53f3780 (patch)
tree339ea31b04b0f23ff8c0bfd5f1c682696e91097e /llvm/lib/DebugInfo/DWARF/DWARFContext.cpp
parentb6e60c8b80704e948cf049569145ddf8497d7e05 (diff)
downloadbcm5719-llvm-e79dda31e9ed6cfc97d06ad87976fb16e53f3780.tar.gz
bcm5719-llvm-e79dda31e9ed6cfc97d06ad87976fb16e53f3780.zip
dwarfdump/symbolizer: Avoid loading unneeded CUs from a DWP
When symbolizing large binaries, parsing every CU in a DWP file is a significant performance penalty. Instead, use the index to only load the CUs that are needed. llvm-svn: 313659
Diffstat (limited to 'llvm/lib/DebugInfo/DWARF/DWARFContext.cpp')
-rw-r--r--llvm/lib/DebugInfo/DWARF/DWARFContext.cpp5
1 files changed, 2 insertions, 3 deletions
diff --git a/llvm/lib/DebugInfo/DWARF/DWARFContext.cpp b/llvm/lib/DebugInfo/DWARF/DWARFContext.cpp
index 90df9f4e787..0e28954f5c1 100644
--- a/llvm/lib/DebugInfo/DWARF/DWARFContext.cpp
+++ b/llvm/lib/DebugInfo/DWARF/DWARFContext.cpp
@@ -464,12 +464,11 @@ void DWARFContext::dump(
}
DWARFCompileUnit *DWARFContext::getDWOCompileUnitForHash(uint64_t Hash) {
- parseDWOCompileUnits();
+ DWOCUs.parseDWO(*this, DObj->getInfoDWOSection(), true);
if (const auto &CUI = getCUIndex()) {
if (const auto *R = CUI.getFromHash(Hash))
- if (auto CUOff = R->getOffset(DW_SECT_INFO))
- return DWOCUs.getUnitForOffset(CUOff->Offset);
+ return DWOCUs.getUnitForIndexEntry(*R);
return nullptr;
}
OpenPOWER on IntegriCloud