DebugInfo: Fix for CU index usage in 309507
Not sure quite how I failed so clearly to test this, but anyway.
llvm-svn: 309514
diff --git a/llvm/lib/DebugInfo/DWARF/DWARFContext.cpp b/llvm/lib/DebugInfo/DWARF/DWARFContext.cpp
index d812191..e840944 100644
--- a/llvm/lib/DebugInfo/DWARF/DWARFContext.cpp
+++ b/llvm/lib/DebugInfo/DWARF/DWARFContext.cpp
@@ -400,10 +400,12 @@
}
DWARFCompileUnit *DWARFContext::getDWOCompileUnitForHash(uint64_t Hash) {
+ parseDWOCompileUnits();
+
if (const auto &CUI = getCUIndex()) {
if (const auto *R = CUI.getFromHash(Hash))
if (auto CUOff = R->getOffset(DW_SECT_INFO))
- return CUs.getUnitForOffset(CUOff->Offset);
+ return DWOCUs.getUnitForOffset(CUOff->Offset);
return nullptr;
}