[driver] When generating clang failure diagnostics, don't try to preprocess

inputs that aren't preprocessable.

llvm-svn: 137532
This commit is contained in:
Chad Rosier 2011-08-12 23:30:05 +00:00
parent 4bc3de4070
commit 4f81fc21a0
1 changed files with 14 additions and 0 deletions

View File

@ -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(),