Fix CompilerInstance::createOutputFile to use proper diagnostics, and (try to) update all clients to be able to handle failure.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90437 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Frontend/CompilerInstance.cpp b/lib/Frontend/CompilerInstance.cpp
index b6c79fb..f36a560 100644
--- a/lib/Frontend/CompilerInstance.cpp
+++ b/lib/Frontend/CompilerInstance.cpp
@@ -328,9 +328,9 @@
                                               InFile, Extension,
                                               &OutputPathName);
   if (!OS) {
-    // FIXME: Don't fail this way.
-    llvm::errs() << "error: " << Error << "\n";
-    ::exit(1);
+    getDiagnostics().Report(diag::err_fe_unable_to_open_output)
+      << OutputPath << Error;
+    return 0;
   }
 
   // Add the output file -- but don't try to remove "-", since this means we are