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:
Erik Eckstein
2019-04-12 16:11:49 -07:00
parent 042b7420d5
commit b8c226cb08
2 changed files with 14 additions and 14 deletions

View File

@@ -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)) {