diff options
author | Nico Weber <nicolasweber@gmx.de> | 2016-03-23 18:17:02 +0000 |
---|---|---|
committer | Nico Weber <nicolasweber@gmx.de> | 2016-03-23 18:17:02 +0000 |
commit | d1728f0e5f5f4ab236febf2ae96949a974dca83a (patch) | |
tree | 75dd4c477c268a22f3537325040402ea2ca734c2 /clang/lib/Driver/Tools.cpp | |
parent | c35c10593bacf534ed93081733dddf2c5396b767 (diff) | |
download | bcm5719-llvm-d1728f0e5f5f4ab236febf2ae96949a974dca83a.tar.gz bcm5719-llvm-d1728f0e5f5f4ab236febf2ae96949a974dca83a.zip |
clang-cl: Add more tests for the interaction of /FI and /Yc /Yu.
Most things even work; see the included FIXMEs for things that need polishing.
Also don't warn about unused flags for the `/Yuh2.h /FIh1.h /FIh2.h`. The
common case is that the pch was built with `/Ych2.h /FIh1.h /FIh2.h`, so h1.h
is in the PCH, and we shouldn't warn about /FIh1.h not having an effect.
(If we wanted to get fancy, we could store the list of -include flags in the
pch and then check that it matches later on.)
llvm-svn: 264178
Diffstat (limited to 'clang/lib/Driver/Tools.cpp')
-rw-r--r-- | clang/lib/Driver/Tools.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/clang/lib/Driver/Tools.cpp b/clang/lib/Driver/Tools.cpp index 9939ce1e315..b18ddd442db 100644 --- a/clang/lib/Driver/Tools.cpp +++ b/clang/lib/Driver/Tools.cpp @@ -428,7 +428,7 @@ void Clang::AddPreprocessingOptions(Compilation &C, const JobAction &JA, // FIXME: The code here assumes that /Yc and /Yu refer to the same file. // cl.exe seems to support both flags with different values, but that // seems strange (which flag does /Fp now refer to?), so don't implement - // that until someone needs that. + // that until someone needs it. int PchIndex = YcIndex != -1 ? YcIndex : YuIndex; if (PchIndex != -1) { if (isa<PrecompileJobAction>(JA)) { @@ -438,8 +438,10 @@ void Clang::AddPreprocessingOptions(Compilation &C, const JobAction &JA, continue; } else { // When using the pch, skip all includes prior to the pch. - if (AI < PchIndex) + if (AI < PchIndex) { + A->claim(); continue; + } if (AI == PchIndex) { A->claim(); CmdArgs.push_back("-include-pch"); |