r201721 - clang-cl: Pass /Z7 when we fallback to cl with debug info enabled

Reid Kleckner reid at kleckner.net
Wed Feb 19 14:06:00 PST 2014


Author: rnk
Date: Wed Feb 19 16:05:59 2014
New Revision: 201721

URL: http://llvm.org/viewvc/llvm-project?rev=201721&view=rev
Log:
clang-cl: Pass /Z7 when we fallback to cl with debug info enabled

Clang itself only emits CodeView line tables, so it seems more
consistent to ask cl.exe for the same format.

Modified:
    cfe/trunk/lib/Driver/Tools.cpp
    cfe/trunk/test/Driver/cl-fallback.c

Modified: cfe/trunk/lib/Driver/Tools.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/Tools.cpp?rev=201721&r1=201720&r2=201721&view=diff
==============================================================================
--- cfe/trunk/lib/Driver/Tools.cpp (original)
+++ cfe/trunk/lib/Driver/Tools.cpp Wed Feb 19 16:05:59 2014
@@ -7221,6 +7221,8 @@ Command *visualstudio::Compile::GetComma
                                                                    : "/GR-");
   if (Args.hasArg(options::OPT_fsyntax_only))
     CmdArgs.push_back("/Zs");
+  if (Args.hasArg(options::OPT_g_Flag, options::OPT_gline_tables_only))
+    CmdArgs.push_back("/Z7");
 
   std::vector<std::string> Includes = Args.getAllArgValues(options::OPT_include);
   for (size_t I = 0, E = Includes.size(); I != E; ++I)

Modified: cfe/trunk/test/Driver/cl-fallback.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/cl-fallback.c?rev=201721&r1=201720&r2=201721&view=diff
==============================================================================
--- cfe/trunk/test/Driver/cl-fallback.c (original)
+++ cfe/trunk/test/Driver/cl-fallback.c Wed Feb 19 16:05:59 2014
@@ -5,7 +5,7 @@
 // command-line option, e.g. on Mac where %s is commonly under /Users.
 
 // RUN: %clang_cl /fallback /Dfoo=bar /Ubaz /Ifoo /O0 /Ox /GR /GR- /LD /LDd \
-// RUN:     /MD /MDd /MTd /MT /FImyheader.h -### -- %s 2>&1 | FileCheck %s
+// RUN:     /MD /MDd /MTd /MT /FImyheader.h /Zi -### -- %s 2>&1 | FileCheck %s
 // CHECK: "-fdiagnostics-format" "msvc-fallback"
 // CHECK: ||
 // CHECK: cl.exe
@@ -17,6 +17,7 @@
 // CHECK: "-I" "foo"
 // CHECK: "/Ox"
 // CHECK: "/GR-"
+// CHECK: "/Z7"
 // CHECK: "/FImyheader.h"
 // CHECK: "/LD"
 // CHECK: "/LDd"





More information about the cfe-commits mailing list