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

David Blaikie via llvm-commits llvm-commits at lists.llvm.org
Tue Nov 14 11:53:11 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:

You could use `enumerate` here, rather than `TUCount`
```
for (const auto &[TU, Index] : enumerate(TUSymbols) {
  TUIndex[TU.UniqueID] = Index;
  TypeUnits.push_back(TU.Label);
}
```

But maybe we don't need this at all? Because all the type units are included, unlike above, where some CUs have to be skipped due to the name table kind?

Oh, actually, maybe /that/ code is missing from here. Or is that checking done elsewhere/earlier? (checking that the CU the TU comes from actually requested Default/Apple names?

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


More information about the llvm-commits mailing list