r266775 - Pass dwarf-version to cc1as.
Douglas Katzman via cfe-commits
cfe-commits at lists.llvm.org
Tue Apr 19 10:43:54 PDT 2016
Author: dougk
Date: Tue Apr 19 12:43:54 2016
New Revision: 266775
URL: http://llvm.org/viewvc/llvm-project?rev=266775&view=rev
Log:
Pass dwarf-version to cc1as.
Fix PR26999 - crashing in cc1as with any '*bsd' target.
Modified:
cfe/trunk/lib/Driver/Tools.cpp
cfe/trunk/test/Driver/save-temps.c
Modified: cfe/trunk/lib/Driver/Tools.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/Tools.cpp?rev=266775&r1=266774&r2=266775&view=diff
==============================================================================
--- cfe/trunk/lib/Driver/Tools.cpp (original)
+++ cfe/trunk/lib/Driver/Tools.cpp Tue Apr 19 12:43:54 2016
@@ -6314,6 +6314,12 @@ void ClangAs::ConstructJob(Compilation &
// 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());
Modified: cfe/trunk/test/Driver/save-temps.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/save-temps.c?rev=266775&r1=266774&r2=266775&view=diff
==============================================================================
--- cfe/trunk/test/Driver/save-temps.c (original)
+++ cfe/trunk/test/Driver/save-temps.c Tue Apr 19 12:43:54 2016
@@ -77,3 +77,8 @@
// CHECK-OBJ-NOO: "-o" "save-temps.s"
// CHECK-OBJ-NOO: "-o" "save-temps.o"
// CHECK-OBJ-NOO: "-o" "a.out"
+
+// RUN: %clang -target i386-unknown-freebsd -save-temps -g -c %s -### 2>&1 \
+// RUN: | FileCheck %s -check-prefix=CHECK-SAVE-TEMPS
+// CHECK-SAVE-TEMPS: "-cc1as"
+// CHECK-SAVE-TEMPS: "-dwarf-version={{.}}"
More information about the cfe-commits
mailing list