[llvm] [LLVM][DWARF] Add support for monolithic types in .debug_names (PR #70515)

David Blaikie via llvm-commits llvm-commits at lists.llvm.org
Wed Nov 15 16:52:06 PST 2023


================
@@ -562,36 +595,58 @@ void llvm::emitDWARF5AccelTable(
     default:
       continue;
     }
-    CUIndex[CU.index()] = Count++;
+    CUIndex[CU.index()] = CUCount++;
     assert(CU.index() == CU.value()->getUniqueID());
     const DwarfCompileUnit *MainCU =
         DD.useSplitDwarf() ? CU.value()->getSkeleton() : CU.value().get();
     CompUnits.push_back(MainCU->getLabelBegin());
   }
 
+  for (const auto &TU : TUSymbols) {
----------------
dwblaikie wrote:

I think I left a comment elsewhere that outlined maybe what we could do - could we assign the unique ID late, when we know it'll be used, like around here:

```
 AccelTypeUnitsDebugNames.convertDieToOffset();
```

The IDs could be assigned before the call, the debug_names finalized (I guess not all type units would have names, though, technically, in an LTO situation, so maybe that makes that difficult) then we would've only used IDs for type units that could have accelerated names, not the discarded ones.

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


More information about the llvm-commits mailing list