[PATCH] D46520: [Driver] Use -fuse-line-directives by default in MSVC mode

Martin Storsjö via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon May 7 13:31:52 PDT 2018


This revision was automatically updated to reflect the committed changes.
Closed by commit rL331666: [Driver] Use -fuse-line-directives by default in MSVC mode (authored by mstorsjo, committed by ).
Herald added a subscriber: llvm-commits.

Changed prior to commit:
  https://reviews.llvm.org/D46520?vs=145446&id=145529#toc

Repository:
  rL LLVM

https://reviews.llvm.org/D46520

Files:
  cfe/trunk/lib/Driver/ToolChains/Clang.cpp
  cfe/trunk/test/Driver/cl-options.c


Index: cfe/trunk/test/Driver/cl-options.c
===================================================================
--- cfe/trunk/test/Driver/cl-options.c
+++ cfe/trunk/test/Driver/cl-options.c
@@ -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
Index: cfe/trunk/lib/Driver/ToolChains/Clang.cpp
===================================================================
--- cfe/trunk/lib/Driver/ToolChains/Clang.cpp
+++ cfe/trunk/lib/Driver/ToolChains/Clang.cpp
@@ -4215,9 +4215,9 @@
                    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.


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D46520.145529.patch
Type: text/x-patch
Size: 1117 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20180507/fa043387/attachment.bin>


More information about the cfe-commits mailing list