From b647552ab7dfdb32edf0081568db1fceec222397 Mon Sep 17 00:00:00 2001 From: Hans Wennborg Date: Tue, 10 Sep 2013 01:07:07 +0000 Subject: [PATCH] clang-cl: use -fdiagnostics-format=msvc by default 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 | 5 +++++ test/Driver/cl.c | 5 +++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/lib/Driver/Tools.cpp b/lib/Driver/Tools.cpp index dd72fd748e..d43758e3ad 100644 --- a/lib/Driver/Tools.cpp +++ b/lib/Driver/Tools.cpp @@ -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, diff --git a/test/Driver/cl.c b/test/Driver/cl.c index 3605197811..4fd4064397 100644 --- a/test/Driver/cl.c +++ b/test/Driver/cl.c @@ -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" -- 2.50.1