Skip to content

Commit c336392

Browse files
committedMay 7, 2018
[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
1 parent 47589e0 commit c336392

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed
 

Diff for: ‎clang/lib/Driver/ToolChains/Clang.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -4215,9 +4215,9 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA,
42154215
IsWindowsMSVC))
42164216
CmdArgs.push_back("-fms-extensions");
42174217

4218-
// -fno-use-line-directives is default.
4218+
// -fno-use-line-directives is default, except for MSVC targets.
42194219
if (Args.hasFlag(options::OPT_fuse_line_directives,
4220-
options::OPT_fno_use_line_directives, false))
4220+
options::OPT_fno_use_line_directives, IsWindowsMSVC))
42214221
CmdArgs.push_back("-fuse-line-directives");
42224222

42234223
// -fms-compatibility=0 is default.

Diff for: ‎clang/test/Driver/cl-options.c

+1
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828

2929
// RUN: %clang_cl /E -### -- %s 2>&1 | FileCheck -check-prefix=E %s
3030
// E: "-E"
31+
// E: "-fuse-line-directives"
3132
// E: "-o" "-"
3233

3334
// RUN: %clang_cl /EP -### -- %s 2>&1 | FileCheck -check-prefix=EP %s

0 commit comments

Comments
 (0)
Please sign in to comment.