]> granicus.if.org Git - clang/commitdiff
Revert "[Driver] Use -fuse-line-directives by default in MSVC mode"
authorMartin Storsjo <martin@martin.st>
Wed, 9 May 2018 09:11:01 +0000 (09:11 +0000)
committerMartin Storsjo <martin@martin.st>
Wed, 9 May 2018 09:11:01 +0000 (09:11 +0000)
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

lib/Driver/ToolChains/Clang.cpp
test/Driver/cl-options.c

index eab5a1aa3837fbbfcd91b9f47b4c12f0f71e529f..4165afcfa9ca14575d7d4acad2dd14dfc603bc1e 100644 (file)
@@ -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.
index ab0d2f9273596e1d012c64f23b9041628f8f7895..7e71fd2db903987bbeb182ab797e004995bb004c 100644 (file)
@@ -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