r331666 - [Driver] Use -fuse-line-directives by default in MSVC mode
Martin Storsjo via cfe-commits
cfe-commits at lists.llvm.org
Mon May 7 13:26:09 PDT 2018
Author: mstorsjo
Date: Mon May 7 13:26:09 2018
New Revision: 331666
URL: http://llvm.org/viewvc/llvm-project?rev=331666&view=rev
Log:
[Driver] Use -fuse-line-directives by default in MSVC mode
Don't use the GNU extension form of line markers in MSVC mode.
Differential Revision: https://reviews.llvm.org/D46520
Modified:
cfe/trunk/lib/Driver/ToolChains/Clang.cpp
cfe/trunk/test/Driver/cl-options.c
Modified: cfe/trunk/lib/Driver/ToolChains/Clang.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/ToolChains/Clang.cpp?rev=331666&r1=331665&r2=331666&view=diff
==============================================================================
--- cfe/trunk/lib/Driver/ToolChains/Clang.cpp (original)
+++ cfe/trunk/lib/Driver/ToolChains/Clang.cpp Mon May 7 13:26:09 2018
@@ -4215,9 +4215,9 @@ void Clang::ConstructJob(Compilation &C,
IsWindowsMSVC))
CmdArgs.push_back("-fms-extensions");
- // -fno-use-line-directives is default.
+ // -fno-use-line-directives is default, except for MSVC targets.
if (Args.hasFlag(options::OPT_fuse_line_directives,
- options::OPT_fno_use_line_directives, false))
+ options::OPT_fno_use_line_directives, IsWindowsMSVC))
CmdArgs.push_back("-fuse-line-directives");
// -fms-compatibility=0 is default.
Modified: cfe/trunk/test/Driver/cl-options.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/cl-options.c?rev=331666&r1=331665&r2=331666&view=diff
==============================================================================
--- cfe/trunk/test/Driver/cl-options.c (original)
+++ cfe/trunk/test/Driver/cl-options.c Mon May 7 13:26:09 2018
@@ -28,6 +28,7 @@
// RUN: %clang_cl /E -### -- %s 2>&1 | FileCheck -check-prefix=E %s
// E: "-E"
+// E: "-fuse-line-directives"
// E: "-o" "-"
// RUN: %clang_cl /EP -### -- %s 2>&1 | FileCheck -check-prefix=EP %s
More information about the cfe-commits
mailing list