From 301a2e21c3a5bb06106ca7e524db53bdddc6d6dd Mon Sep 17 00:00:00 2001 From: Adrian Prantl Date: Wed, 3 Sep 2025 15:42:21 -0700 Subject: [PATCH] Unconditionally enable debug info in ClangImporter when DebuggerSupport is requested --- lib/ClangImporter/ClangImporter.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/ClangImporter/ClangImporter.cpp b/lib/ClangImporter/ClangImporter.cpp index 9ef3e3debdcc4..bd0bfb5892e92 100644 --- a/lib/ClangImporter/ClangImporter.cpp +++ b/lib/ClangImporter/ClangImporter.cpp @@ -862,6 +862,10 @@ importer::addCommonInvocationArguments( invocationArgStrs.push_back("-mcx16"); } + // REPL and LLDB unconditionally want debug info in pcm files. + if (importerOpts.DebuggerSupport) + invocationArgStrs.push_back("-g"); + if (triple.isOSDarwin()) { if (auto variantTriple = ctx.LangOpts.TargetVariant) { // Passing the -target-variant along to clang causes clang's