From: Martin Storsjo Date: Wed, 9 May 2018 09:11:01 +0000 (+0000) Subject: Revert "[Driver] Use -fuse-line-directives by default in MSVC mode" X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=ccafdf4893732aa5d98e41efa3643034b8932c5d;p=clang 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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@331858 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Driver/ToolChains/Clang.cpp b/lib/Driver/ToolChains/Clang.cpp index eab5a1aa38..4165afcfa9 100644 --- a/lib/Driver/ToolChains/Clang.cpp +++ b/lib/Driver/ToolChains/Clang.cpp @@ -4224,9 +4224,9 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA, 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. diff --git a/test/Driver/cl-options.c b/test/Driver/cl-options.c index ab0d2f9273..7e71fd2db9 100644 --- a/test/Driver/cl-options.c +++ b/test/Driver/cl-options.c @@ -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