diff options
Diffstat (limited to 'lib/Driver/Driver.cpp')
-rw-r--r-- | lib/Driver/Driver.cpp | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/lib/Driver/Driver.cpp b/lib/Driver/Driver.cpp index 84321139ff..fee601de73 100644 --- a/lib/Driver/Driver.cpp +++ b/lib/Driver/Driver.cpp @@ -392,15 +392,27 @@ void Driver::generateCompilationDiagnostics(Compilation &C, InputList Inputs; BuildInputs(C.getDefaultToolChain(), C.getArgs(), Inputs); - // Remove any inputs from the input list that cannot be preprocessed. for (InputList::iterator it = Inputs.begin(), ie = Inputs.end(); it != ie;) { - if (types::getPreprocessedType(it->first) == types::TY_INVALID) { + bool IgnoreInput = false; + + // Ignore input from stdin or any inputs that cannot be preprocessed. + if (!strcmp(it->second->getValue(C.getArgs()), "-")) { + Diag(clang::diag::note_drv_command_failed_diag_msg) + << "Error generating preprocessed source(s) - ignoring input from stdin" + "."; + IgnoreInput = true; + } else if (types::getPreprocessedType(it->first) == types::TY_INVALID) { + IgnoreInput = true; + } + + if (IgnoreInput) { it = Inputs.erase(it); ie = Inputs.end(); } else { ++it; } } + if (Inputs.empty()) { Diag(clang::diag::note_drv_command_failed_diag_msg) << "Error generating preprocessed source(s) - no preprocessable inputs."; |