diff options
author | Chad Rosier <mcrosier@apple.com> | 2011-08-12 23:30:05 +0000 |
---|---|---|
committer | Chad Rosier <mcrosier@apple.com> | 2011-08-12 23:30:05 +0000 |
commit | 4f81fc21a021e67453273e6b129b53536e39538c (patch) | |
tree | 45495a2e3ba220fff0a90be7866df34454dcf911 | |
parent | 4bc3de40701fbf5b7858295782eec87ad9c94fb3 (diff) | |
download | bcm5719-llvm-4f81fc21a021e67453273e6b129b53536e39538c.tar.gz bcm5719-llvm-4f81fc21a021e67453273e6b129b53536e39538c.zip |
[driver] When generating clang failure diagnostics, don't try to preprocess
inputs that aren't preprocessable.
llvm-svn: 137532
-rw-r--r-- | clang/lib/Driver/Driver.cpp | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/clang/lib/Driver/Driver.cpp b/clang/lib/Driver/Driver.cpp index bc25ede7c76..710f7dd86a1 100644 --- a/clang/lib/Driver/Driver.cpp +++ b/clang/lib/Driver/Driver.cpp @@ -392,6 +392,20 @@ 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) { + 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."; + return; + } + // Construct the list of abstract actions to perform for this compilation. if (Host->useDriverDriver()) BuildUniversalActions(C.getDefaultToolChain(), C.getArgs(), |