[DebugInfo] Emit embedded swift into DW_AT_APPLE_flags

To properly initialize the compiler instance on LLDB when debugging
embedded Swift programs, emit "-enable-embedded-swift" into the
DW_AT_APPLE_flags attribute of the compile unit.
This commit is contained in:
Augusto Noronha
2024-02-28 15:25:08 -08:00
parent ab9e07d34c
commit 0b8abda060
4 changed files with 26 additions and 4 deletions

View File

@@ -122,14 +122,16 @@ static clang::CodeGenerator *createClangCodeGenerator(ASTContext &Context,
CGO.DebugCompilationDir = Opts.DebugCompilationDir;
CGO.DwarfVersion = Opts.DWARFVersion;
CGO.DwarfDebugFlags =
Opts.getDebugFlags(PD, Context.LangOpts.EnableCXXInterop);
Opts.getDebugFlags(PD, Context.LangOpts.EnableCXXInterop,
Context.LangOpts.hasFeature(Feature::Embedded));
break;
case IRGenDebugInfoFormat::CodeView:
CGO.EmitCodeView = true;
CGO.DebugCompilationDir = Opts.DebugCompilationDir;
// This actually contains the debug flags for codeview.
CGO.DwarfDebugFlags =
Opts.getDebugFlags(PD, Context.LangOpts.EnableCXXInterop);
Opts.getDebugFlags(PD, Context.LangOpts.EnableCXXInterop,
Context.LangOpts.hasFeature(Feature::Embedded));
break;
}
if (!Opts.TrapFuncName.empty()) {