]> granicus.if.org Git - clang/commitdiff
clang-cl: Pass /Z7 when we fallback to cl with debug info enabled
authorReid Kleckner <reid@kleckner.net>
Wed, 19 Feb 2014 22:05:59 +0000 (22:05 +0000)
committerReid Kleckner <reid@kleckner.net>
Wed, 19 Feb 2014 22:05:59 +0000 (22:05 +0000)
Clang itself only emits CodeView line tables, so it seems more
consistent to ask cl.exe for the same format.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@201721 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Driver/Tools.cpp
test/Driver/cl-fallback.c

index c4982d72ec2e40c23bbb3c691007795ce2c0bd62..532c863414fa3b08d6cd2867b32bfd402b9737fa 100644 (file)
@@ -7221,6 +7221,8 @@ Command *visualstudio::Compile::GetCommand(Compilation &C, const JobAction &JA,
                                                                    : "/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)
index d67fa42ca8a450042a9f32477d33db1cf57a94ac..62a71e9835ddfabd1ea8466aecb63b073e1650a6 100644 (file)
@@ -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"