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"
+
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"
+
_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits

Reply via email to