[ClangImporter] Set the debug info level to full debug info.

Upstream clang has introduced a new default level for Linux that sits
between no debug info and full debug info.
This commit is contained in:
Adrian Prantl
2025-09-10 16:49:05 -07:00
parent a1cb24ee39
commit b36c9f89d5
2 changed files with 8 additions and 0 deletions

View File

@@ -1377,6 +1377,8 @@ std::unique_ptr<ClangImporter> ClangImporter::create(
// The Clang modules produced by ClangImporter are always embedded in an // The Clang modules produced by ClangImporter are always embedded in an
// ObjectFilePCHContainer and contain -gmodules debug info. // ObjectFilePCHContainer and contain -gmodules debug info.
importer->Impl.Invocation->getCodeGenOpts().DebugTypeExtRefs = true; importer->Impl.Invocation->getCodeGenOpts().DebugTypeExtRefs = true;
importer->Impl.Invocation->getCodeGenOpts().setDebugInfo(
llvm::codegenoptions::FullDebugInfo);
auto PCHContainerOperations = auto PCHContainerOperations =
std::make_shared<clang::PCHContainerOperations>(); std::make_shared<clang::PCHContainerOperations>();

View File

@@ -2089,6 +2089,12 @@ InterfaceSubContextDelegateImpl::InterfaceSubContextDelegateImpl(
GenericArgs.push_back("-enable-experimental-feature"); GenericArgs.push_back("-enable-experimental-feature");
GenericArgs.push_back("Embedded"); GenericArgs.push_back("Embedded");
} }
if (langOpts.DebuggerSupport) {
subClangImporterOpts.ExtraArgs.push_back("-gmodules");
subClangImporterOpts.ExtraArgs.push_back("-g");
}
} }
/// Calculate an output filename in \p genericSubInvocation's cache path that /// Calculate an output filename in \p genericSubInvocation's cache path that