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

Alexander Yermolovich via llvm-commits llvm-commits at lists.llvm.org
Tue Nov 14 16:03:41 PST 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:

For TUs we try to construct them, but might not succeed. At which point we re-do everything but construct them in the CU. All the instances of TypeUnits that were created are discarded. If we do succeed we will write out TUs in to .debug_info section (for DWARF5), and then release the memory for all the TypeUnit instances. Thus this counter represents all the instances of the TypeUnits that were created, but not necessarily all the TypeUnits that were written out. It is used to assign a unique ID to each instance of TypeUnits which is referenced by DWARF5AcceleratorTable Entry, and is also used in TUSymbols to map being symbol to this ID.

When we write out entries that are for types we use to find in map index in LocalTU.

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


More information about the llvm-commits mailing list