From fc60bf2de11149d2c027d63e7ad5a98afa6fab80 Mon Sep 17 00:00:00 2001 From: Jonas Devlieghere Date: Wed, 14 Jun 2023 13:00:38 -0700 Subject: [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 --- llvm/lib/AsmParser/LLLexer.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'llvm/lib/AsmParser/LLLexer.cpp') diff --git a/llvm/lib/AsmParser/LLLexer.cpp b/llvm/lib/AsmParser/LLLexer.cpp index 23a7b44..7568fd4 100644 --- a/llvm/lib/AsmParser/LLLexer.cpp +++ b/llvm/lib/AsmParser/LLLexer.cpp @@ -944,7 +944,8 @@ lltok::Kind LLLexer::LexIdentifier() { return lltok::EmissionKind; } - if (Keyword == "GNU" || Keyword == "None" || Keyword == "Default") { + if (Keyword == "GNU" || Keyword == "Apple" || Keyword == "None" || + Keyword == "Default") { StrVal.assign(Keyword.begin(), Keyword.end()); return lltok::NameTableKind; } -- cgit v1.1