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-Tag: llvmorg-7.0.0-rc1~6464 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=f1f8f4a1fd116323a6c4f3a4bde87243bab5668d;p=platform%2Fupstream%2Fllvm.git 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. llvm-svn: 331858 --- diff --git a/clang/lib/Driver/ToolChains/Clang.cpp b/clang/lib/Driver/ToolChains/Clang.cpp index eab5a1a..4165afc 100644 --- a/clang/lib/Driver/ToolChains/Clang.cpp +++ b/clang/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/clang/test/Driver/cl-options.c b/clang/test/Driver/cl-options.c index ab0d2f9..7e71fd2 100644 --- a/clang/test/Driver/cl-options.c +++ b/clang/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