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

Alexander Yermolovich via llvm-commits llvm-commits at lists.llvm.org
Thu Nov 2 14:22:44 PDT 2023


================
@@ -409,6 +408,11 @@ class DwarfDebug : public DebugHandlerBase {
       std::pair<std::unique_ptr<DwarfTypeUnit>, const DICompositeType *>, 1>
       TypeUnitsUnderConstruction;
 
+  /// Used to set a uniqe ID for a Type Unit.
+  /// This counter represents number of DwarfTypeUnits created, not necessarily
+  /// number of type units that will be emitted.
+  unsigned NumTypeUnitsCreated = 0;
----------------
ayermolo wrote:

It is used to create a unique ID for each type unit that is created. Which is used to create a "link" between DWARF5AccelTableData and TU it belongs to and TypeUnitMetaInfo. In emitDWARF5AccelTable we iterate over TUSymbols and create a mapping between unique ID and an index in LocalTU.

For CUs it's easier because unique ID just an index in whatever list they are contained. For TUs we 1) can abort TU creation 2) after it was fully construct it disregard it after writing it out. 

Previously this was that static counter.

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


More information about the llvm-commits mailing list