Driver: Add a Tool::hasGoodDiagnostics hook, and use it to simplify logic for
deciding when we need to emit an extra "command failed" diagnostic.
 - This also fixes the case where we were emitting that extra diagnostics, even
   when using clang w/ the integrated assembler, which has good diagnostics.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100529 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Driver/Driver.cpp b/lib/Driver/Driver.cpp
index 921147f..7371a93 100644
--- a/lib/Driver/Driver.cpp
+++ b/lib/Driver/Driver.cpp
@@ -239,12 +239,8 @@
     // other tools are less common, and they generally have worse diagnostics,
     // so always print the diagnostic there.
     const Action &Source = FailingCommand->getSource();
-    bool IsFriendlyTool = (isa<PreprocessJobAction>(Source) ||
-                           isa<PrecompileJobAction>(Source) ||
-                           isa<AnalyzeJobAction>(Source) ||
-                           isa<CompileJobAction>(Source));
 
-    if (!IsFriendlyTool || Res != 1) {
+    if (!FailingCommand->getCreator().hasGoodDiagnostics() || Res != 1) {
       // FIXME: See FIXME above regarding result code interpretation.
       if (Res < 0)
         Diag(clang::diag::err_drv_command_signalled)