diff options
| author | Nico Weber <nicolasweber@gmx.de> | 2016-04-02 19:10:07 +0000 |
|---|---|---|
| committer | Nico Weber <nicolasweber@gmx.de> | 2016-04-02 19:10:07 +0000 |
| commit | d8ff0eedbb95b11f58f053994d8fc0ead3da9088 (patch) | |
| tree | a6d1c49b73f1a3961390865e80785466e5f2a306 /clang | |
| parent | 7e71c61a7ab68a0174e43100833b1c7cea332d45 (diff) | |
| download | bcm5719-llvm-d8ff0eedbb95b11f58f053994d8fc0ead3da9088.tar.gz bcm5719-llvm-d8ff0eedbb95b11f58f053994d8fc0ead3da9088.zip | |
clang-cl: Don't skip i_group flags other than -include when building pchs.
Before this change, e.g. -isystem flags in front of the /FI corresponding to the
pch file would be incorrectly ignored.
llvm-svn: 265238
Diffstat (limited to 'clang')
| -rw-r--r-- | clang/lib/Driver/Tools.cpp | 3 | ||||
| -rw-r--r-- | clang/test/Driver/cl-pch-search.cpp | 4 |
2 files changed, 6 insertions, 1 deletions
diff --git a/clang/lib/Driver/Tools.cpp b/clang/lib/Driver/Tools.cpp index b7981c045e3..824ee72dcd2 100644 --- a/clang/lib/Driver/Tools.cpp +++ b/clang/lib/Driver/Tools.cpp @@ -416,7 +416,8 @@ void Clang::AddPreprocessingOptions(Compilation &C, const JobAction &JA, for (const Arg *A : Args.filtered(options::OPT_clang_i_Group)) { ++AI; - if (getToolChain().getDriver().IsCLMode()) { + if (getToolChain().getDriver().IsCLMode() && + A->getOption().matches(options::OPT_include)) { // In clang-cl mode, /Ycfoo.h means that all code up to a foo.h // include is compiled into foo.h, and everything after goes into // the .obj file. /Yufoo.h means that all includes prior to and including diff --git a/clang/test/Driver/cl-pch-search.cpp b/clang/test/Driver/cl-pch-search.cpp index 118cf19efbd..fd503f1f801 100644 --- a/clang/test/Driver/cl-pch-search.cpp +++ b/clang/test/Driver/cl-pch-search.cpp @@ -4,3 +4,7 @@ // REQUIRES: x86-registered-target // Check that pchfile.h next to to pchfile.cc is found correctly. // RUN: %clang_cl -Werror /Ycpchfile.h /FIpchfile.h /c /Fo%t.obj /Fp%t.pch -- %S/Inputs/pchfile.cpp + +// Check that i_group flags other than -include aren't skipped (e.g. -isystem). +#include "header0.h" +// RUN: %clang_cl -Werror -isystem%S/Inputs /Yupchfile.h /FIpchfile.h /c /Fo%t.obj /Fp%t.pch -- %s |

