aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/AsmParser/LLLexer.cpp
diff options
context:
space:
mode:
authorJonas Devlieghere <jonas@devlieghere.com>2023-06-14 13:00:38 -0700
committerJonas Devlieghere <jonas@devlieghere.com>2023-06-14 13:03:31 -0700
commite0d57295bf6a3c04f2901d9c70f529d570f48b65 (patch)
treed586d52e182c507d00fbf52cc99ab80e0c11e88d /llvm/lib/AsmParser/LLLexer.cpp
parentfd68d36109c6fcebb6d758046b88b0664acccf51 (diff)
downloadllvm-e0d57295bf6a3c04f2901d9c70f529d570f48b65.zip
llvm-e0d57295bf6a3c04f2901d9c70f529d570f48b65.tar.gz
llvm-e0d57295bf6a3c04f2901d9c70f529d570f48b65.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/AsmParser/LLLexer.cpp')
-rw-r--r--llvm/lib/AsmParser/LLLexer.cpp3
1 files changed, 2 insertions, 1 deletions
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;
}