Driver: Give Compilation::Execute total control over the Driver result
code; and don't return an error code when -### is present, even if
errors occur.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67425 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Driver/Compilation.cpp b/lib/Driver/Compilation.cpp
index 48796af..a2fc921 100644
--- a/lib/Driver/Compilation.cpp
+++ b/lib/Driver/Compilation.cpp
@@ -160,6 +160,10 @@
     return 0;
   }
 
+  // If there were errors building the compilation, quit now.
+  if (getDriver().getDiags().getNumErrors())
+    return 1;
+
   int Res = ExecuteJob(Jobs);
   
   // Remove temp files.