diff options
author | Reid Kleckner <reid@kleckner.net> | 2015-02-26 00:17:25 +0000 |
---|---|---|
committer | Reid Kleckner <reid@kleckner.net> | 2015-02-26 00:17:25 +0000 |
commit | 1df0fea5939970f6ba4e77aa00a0d2ecadbad3ec (patch) | |
tree | fdf890a5b7d833fbef5cc6489e7f64aba4bdef4c /clang/lib/Driver/Tools.cpp | |
parent | ebdfc00995264d2cd3795824c8074e03e6322d35 (diff) | |
download | bcm5719-llvm-1df0fea5939970f6ba4e77aa00a0d2ecadbad3ec.tar.gz bcm5719-llvm-1df0fea5939970f6ba4e77aa00a0d2ecadbad3ec.zip |
Add -fuse-line-directive flag to control usage of #line with -E
Currently -fms-extensions controls this behavior, which doesn't make
much sense. It means we can't identify what is and isn't a system header
when compiling our own preprocessed output, because #line doesn't
represent this information.
If someone is feeding Clang's preprocessed output to another compiler,
they can use this flag.
Fixes PR20553.
Reviewers: rsmith
Differential Revision: http://reviews.llvm.org/D5217
llvm-svn: 230587
Diffstat (limited to 'clang/lib/Driver/Tools.cpp')
-rw-r--r-- | clang/lib/Driver/Tools.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/clang/lib/Driver/Tools.cpp b/clang/lib/Driver/Tools.cpp index c04737544f2..b0e581bc78b 100644 --- a/clang/lib/Driver/Tools.cpp +++ b/clang/lib/Driver/Tools.cpp @@ -4067,6 +4067,11 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA, IsWindowsMSVC)) CmdArgs.push_back("-fms-extensions"); + // -fno-use-line-directives is default. + if (Args.hasFlag(options::OPT_fuse_line_directives, + options::OPT_fno_use_line_directives, false)) + CmdArgs.push_back("-fuse-line-directives"); + // -fms-compatibility=0 is default. if (Args.hasFlag(options::OPT_fms_compatibility, options::OPT_fno_ms_compatibility, |