Pull r266775 from upstream clang trunk (by Douglas Katzman):

Pass dwarf-version to cc1as.

  Fix PR26999 - crashing in cc1as with any '*bsd' target.

This should fix possible crashes when using -g in combination with
-save-temps.
This commit is contained in:
dim 2016-04-21 20:38:10 +00:00
parent b4208064d2
commit ad985a2ffd

View File

@ -6061,6 +6061,12 @@ void ClangAs::ConstructJob(Compilation &C, const JobAction &JA,
// FIXME: Stop lying and consume only the appropriate driver flags
Args.ClaimAllArgs(options::OPT_W_Group);
// Assemblers that want to know the dwarf version can't assume a value,
// since the defaulting logic resides in the driver. Put in something
// reasonable now, in case a subsequent "-Wa,-g" changes it.
RenderDebugEnablingArgs(Args, CmdArgs, CodeGenOptions::NoDebugInfo,
getToolChain().GetDefaultDwarfVersion(),
llvm::DebuggerKind::Default);
CollectArgsForIntegratedAssembler(C, Args, CmdArgs,
getToolChain().getDriver());