mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
Make DWARF debug flag behavior match Clang.
Only write the compilation flags to debug info for Mach-O targets, and only if the RC_DEBUG_OPTIONS environment variable is set.
This commit is contained in:
@@ -769,12 +769,14 @@ static bool ParseIRGenArgs(IRGenOptions &Opts, ArgList &Args,
|
||||
"unknown -g<kind> option");
|
||||
|
||||
if (Opts.DebugInfoKind > IRGenDebugInfoKind::LineTables) {
|
||||
ArgStringList RenderedArgs;
|
||||
for (auto A : Args)
|
||||
A->render(Args, RenderedArgs);
|
||||
CompilerInvocation::buildDWARFDebugFlags(Opts.DWARFDebugFlags,
|
||||
RenderedArgs, SDKPath,
|
||||
ResourceDir);
|
||||
if (Args.hasArg(options::OPT_use_dwarf_debug_flags)) {
|
||||
ArgStringList RenderedArgs;
|
||||
for (auto A : Args)
|
||||
A->render(Args, RenderedArgs);
|
||||
CompilerInvocation::buildDWARFDebugFlags(Opts.DWARFDebugFlags,
|
||||
RenderedArgs, SDKPath,
|
||||
ResourceDir);
|
||||
}
|
||||
// TODO: Should we support -fdebug-compilation-dir?
|
||||
llvm::SmallString<256> cwd;
|
||||
llvm::sys::fs::current_path(cwd);
|
||||
|
||||
Reference in New Issue
Block a user