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

David Blaikie via llvm-commits llvm-commits at lists.llvm.org
Fri Oct 13 14:03:05 PDT 2023


================
@@ -3514,11 +3520,15 @@ void DwarfDebug::addDwarfTypeUnitType(DwarfCompileUnit &CU,
       return;
     }
 
-    // If the type wasn't dependent on fission addresses, finish adding the type
-    // and all its dependent types.
     for (auto &TU : TypeUnitsToAdd) {
       InfoHolder.computeSizeAndOffsetsForUnit(TU.first.get());
       InfoHolder.emitUnit(TU.first.get(), useSplitDwarf());
+      if (getDwarfVersion() >= 5 &&
+          getAccelTableKind() == AccelTableKind::Dwarf) {
+        addTypeUnit(std::move(TU.first));
----------------
dwblaikie wrote:

Yeah, that seems significant enough that it'd be worth preserving the behavior if reasonably possible.

So this work might end up looking more like a patch to change the way the current index works - to not depend on DIEs having a long lifetime (replacing DIE pointers with offsets - I guess maybe a union of the two, and we go through some lowering phase where the DIE pointer is read, the offset is retrieved (once known) and then the DIE pointer is replaced with the offset value) - just a pure refactor, no functional change. Then this patch could benefit from that restructure & avoid the memory regression/wouldn't need to extend the lifetime of type units.

Sound good?

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


More information about the llvm-commits mailing list