[BOLT] Exit with error code on missing DWO CU (#125976)

If BOLT fails to locate DWO CU when using split DWARF, this signifies an
issue with the input (missing .dwo) rather than an internal assertion.
This commit is contained in:
Amir Ayupov 2025-02-06 10:01:12 -08:00 committed by GitHub
parent 2feee52457
commit b884be8640
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1759,7 +1759,11 @@ void BinaryContext::preprocessDebugInfo() {
dwarf::toString(CU->getUnitDIE().find(dwarf::DW_AT_name), nullptr);
if (std::optional<uint64_t> DWOID = CU->getDWOId()) {
auto Iter = DWOCUs.find(*DWOID);
assert(Iter != DWOCUs.end() && "DWO CU was not found.");
if (Iter == DWOCUs.end()) {
this->errs() << "BOLT-ERROR: DWO CU was not found for " << Name
<< '\n';
exit(1);
}
Name = dwarf::toString(
Iter->second->getUnitDIE().find(dwarf::DW_AT_name), nullptr);
}