[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:40:12 PST 2023
================
@@ -3552,8 +3565,16 @@ void DwarfDebug::addAccelNameImpl(const DICompileUnit &CU,
AppleAccel.addName(Ref, Die);
break;
case AccelTableKind::Dwarf: {
- DwarfCompileUnit *DCU = CUMap.lookup(&CU);
- AccelDebugNames.addName(Ref, Die, *DCU);
+ DWARF5AccelTable &Current = getCurrentDWARF5AccelTable();
+ // The type unit can be discarded, so need to add references to final
+ // acceleration table once we know it's complete and we emit it.
+ if (getCurrentAccelTableKind() == DWARF5AccelTableKind::CU) {
+ DwarfCompileUnit *Unit = CUMap.lookup(&CU);
+ Current.addName(Ref, Die, *Unit);
+ } else {
+ DwarfTypeUnit *Unit = TypeUnitsUnderConstruction.back().first.get();
+ Current.addName(Ref, Die, *Unit);
+ }
----------------
ayermolo wrote:
OK, plumbed through DwarfUnit and TableKind. Side affect I think it also simplifies things because we don't need to use CUMap.
https://github.com/llvm/llvm-project/pull/70515
More information about the llvm-commits
mailing list