diff --git a/clang/lib/Driver/ToolChains/Clang.cpp b/clang/lib/Driver/ToolChains/Clang.cpp --- a/clang/lib/Driver/ToolChains/Clang.cpp +++ b/clang/lib/Driver/ToolChains/Clang.cpp @@ -3940,14 +3940,14 @@ CmdArgs.push_back("-gno-inline-line-tables"); } - // Adjust the debug info kind for the given toolchain. - TC.adjustDebugInfoKind(DebugInfoKind, Args); - // When emitting remarks, we need at least debug lines in the output. if (willEmitRemarks(Args) && DebugInfoKind <= codegenoptions::DebugDirectivesOnly) DebugInfoKind = codegenoptions::DebugLineTablesOnly; + // Adjust the debug info kind for the given toolchain. + TC.adjustDebugInfoKind(DebugInfoKind, Args); + RenderDebugEnablingArgs(Args, CmdArgs, DebugInfoKind, EffectiveDWARFVersion, DebuggerTuning); diff --git a/clang/lib/Driver/ToolChains/Cuda.cpp b/clang/lib/Driver/ToolChains/Cuda.cpp --- a/clang/lib/Driver/ToolChains/Cuda.cpp +++ b/clang/lib/Driver/ToolChains/Cuda.cpp @@ -384,7 +384,7 @@ } return IsDebugEnabled ? EmitSameDebugInfoAsHost : DebugDirectivesOnly; } - return DisableDebugInfo; + return willEmitRemarks(Args) ? DebugDirectivesOnly : DisableDebugInfo; } void NVPTX::Assembler::ConstructJob(Compilation &C, const JobAction &JA,