diff options
author | Chad Rosier <mcrosier@apple.com> | 2011-08-18 00:22:25 +0000 |
---|---|---|
committer | Chad Rosier <mcrosier@apple.com> | 2011-08-18 00:22:25 +0000 |
commit | d57133dcca73faea88399f761b4eb2b95f6f30f2 (patch) | |
tree | 436655364528415c9c3a9db0063f3375ce22c99e /clang/lib | |
parent | bf9246d1f0215c2202417c0050d91cfbbf986e42 (diff) | |
download | bcm5719-llvm-d57133dcca73faea88399f761b4eb2b95f6f30f2.tar.gz bcm5719-llvm-d57133dcca73faea88399f761b4eb2b95f6f30f2.zip |
[driver] Don't generate diagnostics (i.e., preprocessed source) if reading
from stdin. This allows Eli and the like to continue with their debugging
trickery without loss of limb (or car) on my part. :)
llvm-svn: 137906
Diffstat (limited to 'clang/lib')
-rw-r--r-- | clang/lib/Driver/Driver.cpp | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/clang/lib/Driver/Driver.cpp b/clang/lib/Driver/Driver.cpp index 84321139ff2..fee601de736 100644 --- a/clang/lib/Driver/Driver.cpp +++ b/clang/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."; |