From 0fcf59c5a539f20b9e5e5230548de3dcc25cc8e0 Mon Sep 17 00:00:00 2001 From: Reid Kleckner Date: Wed, 19 Feb 2014 22:05:59 +0000 Subject: [PATCH] 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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@201721 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Driver/Tools.cpp | 2 ++ test/Driver/cl-fallback.c | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/Driver/Tools.cpp b/lib/Driver/Tools.cpp index c4982d72ec..532c863414 100644 --- a/lib/Driver/Tools.cpp +++ b/lib/Driver/Tools.cpp @@ -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 Includes = Args.getAllArgValues(options::OPT_include); for (size_t I = 0, E = Includes.size(); I != E; ++I) diff --git a/test/Driver/cl-fallback.c b/test/Driver/cl-fallback.c index d67fa42ca8..62a71e9835 100644 --- a/test/Driver/cl-fallback.c +++ b/test/Driver/cl-fallback.c @@ -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" -- 2.40.0