diff options
Diffstat (limited to 'lib/Driver/Tools.cpp')
-rw-r--r-- | lib/Driver/Tools.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/lib/Driver/Tools.cpp b/lib/Driver/Tools.cpp index 229cf608f3..fd57cffbc5 100644 --- a/lib/Driver/Tools.cpp +++ b/lib/Driver/Tools.cpp @@ -256,6 +256,16 @@ void Clang::AddPreprocessingOptions(const Driver &D, if (FoundPCH || FoundPTH) { if (IsFirstImplicitInclude) { A->claim(); + if (P.isDirectory()) { + // Expect to find a precompiled header matching the current input type + P.appendComponent(types::getTypeName(Inputs[0].getType())); + if (!P.exists()) { + D.Diag(clang::diag::warn_drv_pch_missing_language) + << A->getAsString(Args) << P.str() + << types::getTypeName(Inputs[0].getType()); + continue; + } + } if (UsePCH) CmdArgs.push_back("-include-pch"); else |