Fix CompilerInstance::createOutputFile to use proper diagnostics, and (try to) update all clients to be able to handle failure.
llvm-svn: 90437
diff --git a/clang/lib/Frontend/CompilerInstance.cpp b/clang/lib/Frontend/CompilerInstance.cpp
index b6c79fb..f36a560 100644
--- a/clang/lib/Frontend/CompilerInstance.cpp
+++ b/clang/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