]> granicus.if.org Git - clang/commitdiff
clang-cl: use -fdiagnostics-format=msvc by default
authorHans Wennborg <hans@hanshq.net>
Tue, 10 Sep 2013 01:07:07 +0000 (01:07 +0000)
committerHans Wennborg <hans@hanshq.net>
Tue, 10 Sep 2013 01:07:07 +0000 (01:07 +0000)
This allows for navigating to errors within the MSVC IDE by clicking
on the diagnostics.

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

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

index dd72fd748eea04f25e061bd2cdd46a92a7db46d9..d43758e3ad611f05225f0d6f4c6a2e5f430b230a 100644 (file)
@@ -3757,6 +3757,11 @@ void Clang::AddClangCLArgs(const ArgList &Args, ArgStringList &CmdArgs) const {
 
   if (Arg *A = Args.getLastArg(options::OPT_show_includes))
     A->render(Args, CmdArgs);
+
+  if (!Args.hasArg(options::OPT_fdiagnostics_format_EQ)) {
+    CmdArgs.push_back("-fdiagnostics-format");
+    CmdArgs.push_back("msvc");
+  }
 }
 
 void ClangAs::ConstructJob(Compilation &C, const JobAction &JA,
index 3605197811e8532765af56a867fc208207c20d76..4fd406439797fd33b5d368e4284762ed3736bdb9 100644 (file)
@@ -30,5 +30,6 @@
 // DEFAULT: -fapple-kext
 // CL-NOT: -fapple-kext
 
-// RUN: %clang_cl /c -### -- %s 2>&1 | FileCheck -check-prefix=ABI %s
-// ABI: "-cxx-abi" "microsoft"
+// RUN: %clang_cl /c -### -- %s 2>&1 | FileCheck -check-prefix=COMPILE %s
+// COMPILE: "-cxx-abi" "microsoft"
+// COMPILE: "-fdiagnostics-format" "msvc"