[llvm] [BOLT][DWARF] Skip processing DWARF CUs with a DWO ID but no DWO name. (PR #154749)

Alexander Yermolovich via llvm-commits llvm-commits at lists.llvm.org
Fri Sep 12 08:02:36 PDT 2025


================
@@ -1008,12 +1009,15 @@ static uint64_t getHash(const DWARFUnit &DU) {
   return DU.getOffset();
 }
 
-void DIEBuilder::registerUnit(DWARFUnit &DU, bool NeedSort) {
+bool DIEBuilder::registerUnit(DWARFUnit &DU, bool NeedSort) {
+  if (DU.getDWOId() && !DU.isDWOUnit() &&
+      !DU.getUnitDIE().find({dwarf::DW_AT_dwo_name, dwarf::DW_AT_GNU_dwo_name}))
+    return false;
----------------
ayermolo wrote:

Please add a warning here, similar to one in BinaryContext.cpp

https://github.com/llvm/llvm-project/pull/154749


More information about the llvm-commits mailing list