diff options
Diffstat (limited to 'lib/Driver/Driver.cpp')
-rw-r--r-- | lib/Driver/Driver.cpp | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/lib/Driver/Driver.cpp b/lib/Driver/Driver.cpp index 6fb7c98e5e..1d72b0dbd6 100644 --- a/lib/Driver/Driver.cpp +++ b/lib/Driver/Driver.cpp @@ -803,10 +803,19 @@ void Driver::BuildActions(const ArgList &Args, ActionList &Actions) const { if (InitialPhase > FinalPhase) { // Claim here to avoid the more general unused warning. InputArg->claim(); - Diag(clang::diag::warn_drv_input_file_unused) - << InputArg->getAsString(Args) - << getPhaseName(InitialPhase) - << FinalPhaseArg->getOption().getName(); + + // Special case '-E' warning on a previously preprocessed file to make + // more sense. + if (InitialPhase == phases::Compile && FinalPhase == phases::Preprocess && + getPreprocessedType(InputType) == types::TY_INVALID) + Diag(clang::diag::warn_drv_preprocessed_input_file_unused) + << InputArg->getAsString(Args) + << FinalPhaseArg->getOption().getName(); + else + Diag(clang::diag::warn_drv_input_file_unused) + << InputArg->getAsString(Args) + << getPhaseName(InitialPhase) + << FinalPhaseArg->getOption().getName(); continue; } |