diff options
author | Jonas Devlieghere <jonas@devlieghere.com> | 2023-06-14 13:00:38 -0700 |
---|---|---|
committer | Jonas Devlieghere <jonas@devlieghere.com> | 2023-06-14 15:28:33 -0700 |
commit | fc60bf2de11149d2c027d63e7ad5a98afa6fab80 (patch) | |
tree | 602c8630448f174ba1cdcbaa2d234853472eab50 /llvm/lib/CodeGen/AsmPrinter/AccelTable.cpp | |
parent | e879fded2a0267a974994efcb9212efb615f3305 (diff) | |
download | llvm-fc60bf2de11149d2c027d63e7ad5a98afa6fab80.zip llvm-fc60bf2de11149d2c027d63e7ad5a98afa6fab80.tar.gz llvm-fc60bf2de11149d2c027d63e7ad5a98afa6fab80.tar.bz2 |
[DebugInfo] Always emit `.debug_names` with DWARF 5 for Apple platforms
On Apple platforms, we generate .apple_names, .apple_types,
.apple_namespaces and .apple_objc Apple accelerator tables for DWARF 4
and earlier. For DWARF 5 we should generate .debug_names, but instead we
get no accelerator tables at all.
In the backend we are correctly determining that we should be emitting
.debug_names instead of .apple_names. However, when we get to the point
of emitting the section, if the CU debug name table kind is not
"default", the accelerator table emission is skipped.
This patch sets the DebugNameTableKind to Apple in the frontend when
target an Apple target. That way we know that the CU was compiled with
the intent of emitting accelerator tables. For DWARF 4 and earlier, that
means Apple accelerator tables. For DWARF 5 and later, that means .debug
names.
Differential revision: https://reviews.llvm.org/D118754
Diffstat (limited to 'llvm/lib/CodeGen/AsmPrinter/AccelTable.cpp')
-rw-r--r-- | llvm/lib/CodeGen/AsmPrinter/AccelTable.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/llvm/lib/CodeGen/AsmPrinter/AccelTable.cpp b/llvm/lib/CodeGen/AsmPrinter/AccelTable.cpp index a533551..5f9c3ea 100644 --- a/llvm/lib/CodeGen/AsmPrinter/AccelTable.cpp +++ b/llvm/lib/CodeGen/AsmPrinter/AccelTable.cpp @@ -549,9 +549,13 @@ void llvm::emitDWARF5AccelTable( SmallVector<unsigned, 1> CUIndex(CUs.size()); int Count = 0; for (const auto &CU : enumerate(CUs)) { - if (CU.value()->getCUNode()->getNameTableKind() != - DICompileUnit::DebugNameTableKind::Default) + switch (CU.value()->getCUNode()->getNameTableKind()) { + case DICompileUnit::DebugNameTableKind::Default: + case DICompileUnit::DebugNameTableKind::Apple: + break; + default: continue; + } CUIndex[CU.index()] = Count++; assert(CU.index() == CU.value()->getUniqueID()); const DwarfCompileUnit *MainCU = |