summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMartin Storsjo <martin@martin.st>2018-05-07 20:26:09 +0000
committerMartin Storsjo <martin@martin.st>2018-05-07 20:26:09 +0000
commitc33639227e05f8e3c3888e102021d1b610208853 (patch)
tree898f8290117e519218d86a554cfcfe4f35c82fb7
parent47589e09dd6cfd731a257bbcdf06a34878cd2656 (diff)
downloadbcm5719-llvm-c33639227e05f8e3c3888e102021d1b610208853.tar.gz
bcm5719-llvm-c33639227e05f8e3c3888e102021d1b610208853.zip
[Driver] Use -fuse-line-directives by default in MSVC mode
Don't use the GNU extension form of line markers in MSVC mode. Differential Revision: https://reviews.llvm.org/D46520 llvm-svn: 331666
-rw-r--r--clang/lib/Driver/ToolChains/Clang.cpp4
-rw-r--r--clang/test/Driver/cl-options.c1
2 files changed, 3 insertions, 2 deletions
diff --git a/clang/lib/Driver/ToolChains/Clang.cpp b/clang/lib/Driver/ToolChains/Clang.cpp
index ef76817c362..6f05fd1fa51 100644
--- a/clang/lib/Driver/ToolChains/Clang.cpp
+++ b/clang/lib/Driver/ToolChains/Clang.cpp
@@ -4215,9 +4215,9 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA,
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.
diff --git a/clang/test/Driver/cl-options.c b/clang/test/Driver/cl-options.c
index 7e71fd2db90..ab0d2f92735 100644
--- a/clang/test/Driver/cl-options.c
+++ b/clang/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
OpenPOWER on IntegriCloud