[PATCH] XCore target: fix handling of -g0 flag
robert lytton
robert at xmos.com
Tue Apr 29 06:10:27 PDT 2014
Hi friedgold,
All -g* flags were setting -g in the assembler.
The -g0 flag should not cause a -g.
http://reviews.llvm.org/D3538
Files:
lib/Driver/Tools.cpp
test/Driver/xcore-opts.c
Index: lib/Driver/Tools.cpp
===================================================================
--- lib/Driver/Tools.cpp
+++ lib/Driver/Tools.cpp
@@ -7631,8 +7631,9 @@
if (Args.hasArg(options::OPT_v))
CmdArgs.push_back("-v");
- if (Args.hasArg(options::OPT_g_Group))
- CmdArgs.push_back("-g");
+ if (Arg *A = Args.getLastArg(options::OPT_g_Group))
+ if (!A->getOption().matches(options::OPT_g0))
+ CmdArgs.push_back("-g");
if (Args.hasFlag(options::OPT_fverbose_asm, options::OPT_fno_verbose_asm,
false))
Index: test/Driver/xcore-opts.c
===================================================================
--- test/Driver/xcore-opts.c
+++ test/Driver/xcore-opts.c
@@ -1,6 +1,7 @@
// RUN: %clang -target xcore %s -g -Wl,L1Arg,L2Arg -Wa,A1Arg,A2Arg -fverbose-asm -v -### -o %t.o 2>&1 | FileCheck %s
// RUN: %clang -target xcore -x c++ %s -g -Wl,L1Arg,L2Arg -Wa,A1Arg,A2Arg -fverbose-asm -v -### -o %t.o 2>&1 | FileCheck %s
// RUN: %clang -target xcore -x c++ %s -fexceptions -### -o %t.o 2>&1 | FileCheck -check-prefix CHECK-EXCEP %s
+// RUN: %clang -target xcore %s -g0 -### -o %t.o 2>&1 | FileCheck -check-prefix CHECK-G0 %s
// CHECK: "-nostdsysteminc"
// CHECK: "-momit-leaf-frame-pointer"
@@ -27,3 +28,7 @@
// CHECK-EXCEP: xcc" "-o"
// CHECK-EXCEP: "-fexceptions"
+// CHECK-G0: xcc"
+// CHECK-G0-NOT: "-g"
+// CHECK-G0: xcc"
+
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D3538.8915.patch
Type: text/x-patch
Size: 1387 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20140429/4b331093/attachment.bin>
More information about the cfe-commits
mailing list