r331858 - Revert "[Driver] Use -fuse-line-directives by default in MSVC mode"
Martin Storsjo via cfe-commits
cfe-commits at lists.llvm.org
Wed May 9 02:11:01 PDT 2018
Author: mstorsjo
Date: Wed May 9 02:11:01 2018
New Revision: 331858
URL: http://llvm.org/viewvc/llvm-project?rev=331858&view=rev
Log:
Revert "[Driver] Use -fuse-line-directives by default in MSVC mode"
This reverts commit SVN r331666.
It was afterwards pointed out in https://reviews.llvm.org/D46520
that #line directives lose information about what parts come from a
system header. That means the result of -E usually won't compile,
since Windows headers are typically full of warnings and
default-error warnings.
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=331858&r1=331857&r2=331858&view=diff
==============================================================================
--- cfe/trunk/lib/Driver/ToolChains/Clang.cpp (original)
+++ cfe/trunk/lib/Driver/ToolChains/Clang.cpp Wed May 9 02:11:01 2018
@@ -4224,9 +4224,9 @@ void Clang::ConstructJob(Compilation &C,
IsWindowsMSVC))
CmdArgs.push_back("-fms-extensions");
- // -fno-use-line-directives is default, except for MSVC targets.
+ // -fno-use-line-directives is default.
if (Args.hasFlag(options::OPT_fuse_line_directives,
- options::OPT_fno_use_line_directives, IsWindowsMSVC))
+ options::OPT_fno_use_line_directives, false))
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=331858&r1=331857&r2=331858&view=diff
==============================================================================
--- cfe/trunk/test/Driver/cl-options.c (original)
+++ cfe/trunk/test/Driver/cl-options.c Wed May 9 02:11:01 2018
@@ -28,7 +28,6 @@
// 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