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

Alexander Yermolovich via llvm-commits llvm-commits at lists.llvm.org
Wed Oct 4 16:10:49 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));
----------------
ayermolo wrote:

> If I recall correctly... it's important that type units get discarded once emitted, for compiler memory use reasons. So keeping them around until we emit the name table might not be feasible.
> 
> Have you/can you measure the memory usage increase this change causes for some practical examples?

I have not. Were you thinking for one invocation of clang, or to build whole project?
What do you think a reasonable number of type units pre compilation modules are?

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


More information about the llvm-commits mailing list