mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
DebugInfo: fix debugging on SIL level
The fix is to set the DebugCompilationDir when -gsil is used. Otherwise no debug info is generated if the source file name does not contain a path. rdar://problem/49796695
This commit is contained in:
@@ -902,21 +902,20 @@ static bool ParseIRGenArgs(IRGenOptions &Opts, ArgList &Args,
|
||||
else
|
||||
assert(A->getOption().matches(options::OPT_gnone) &&
|
||||
"unknown -g<kind> option");
|
||||
|
||||
if (Opts.DebugInfoLevel > IRGenDebugInfoLevel::LineTables) {
|
||||
if (Args.hasArg(options::OPT_debug_info_store_invocation)) {
|
||||
ArgStringList RenderedArgs;
|
||||
for (auto A : Args)
|
||||
A->render(Args, RenderedArgs);
|
||||
CompilerInvocation::buildDebugFlags(Opts.DebugFlags,
|
||||
RenderedArgs, SDKPath,
|
||||
ResourceDir);
|
||||
}
|
||||
// TODO: Should we support -fdebug-compilation-dir?
|
||||
llvm::SmallString<256> cwd;
|
||||
llvm::sys::fs::current_path(cwd);
|
||||
Opts.DebugCompilationDir = cwd.str();
|
||||
}
|
||||
if (Opts.DebugInfoLevel >= IRGenDebugInfoLevel::LineTables) {
|
||||
if (Args.hasArg(options::OPT_debug_info_store_invocation)) {
|
||||
ArgStringList RenderedArgs;
|
||||
for (auto A : Args)
|
||||
A->render(Args, RenderedArgs);
|
||||
CompilerInvocation::buildDebugFlags(Opts.DebugFlags,
|
||||
RenderedArgs, SDKPath,
|
||||
ResourceDir);
|
||||
}
|
||||
// TODO: Should we support -fdebug-compilation-dir?
|
||||
llvm::SmallString<256> cwd;
|
||||
llvm::sys::fs::current_path(cwd);
|
||||
Opts.DebugCompilationDir = cwd.str();
|
||||
}
|
||||
|
||||
if (const Arg *A = Args.getLastArg(options::OPT_debug_info_format)) {
|
||||
|
||||
Reference in New Issue
Block a user