summaryrefslogtreecommitdiffstats
path: root/clang/lib/Frontend/CompilerInstance.cpp
diff options
context:
space:
mode:
authorDaniel Dunbar <daniel@zuster.org>2009-11-20 22:32:38 +0000
committerDaniel Dunbar <daniel@zuster.org>2009-11-20 22:32:38 +0000
commit2eaef18e76e402c20f6f8da6dd8f41f42dec45ab (patch)
treea17900750f0a9508aca26280d5547a63731dfe39 /clang/lib/Frontend/CompilerInstance.cpp
parent32164f4bdb81cfd6aea0d933328346b15db8e41e (diff)
downloadbcm5719-llvm-2eaef18e76e402c20f6f8da6dd8f41f42dec45ab.tar.gz
bcm5719-llvm-2eaef18e76e402c20f6f8da6dd8f41f42dec45ab.zip
Fix refactoro, clang-cc wasn't properly reporting errors when opening an output file failed.
llvm-svn: 89502
Diffstat (limited to 'clang/lib/Frontend/CompilerInstance.cpp')
-rw-r--r--clang/lib/Frontend/CompilerInstance.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/clang/lib/Frontend/CompilerInstance.cpp b/clang/lib/Frontend/CompilerInstance.cpp
index 0365761c840..872b7713f32 100644
--- a/clang/lib/Frontend/CompilerInstance.cpp
+++ b/clang/lib/Frontend/CompilerInstance.cpp
@@ -321,7 +321,7 @@ CompilerInstance::createOutputFile(llvm::StringRef OutputPath,
&OutputPathName);
if (!OS) {
// FIXME: Don't fail this way.
- llvm::errs() << "ERROR: " << Error << "\n";
+ llvm::errs() << "error: " << Error << "\n";
::exit(1);
}
@@ -353,16 +353,16 @@ CompilerInstance::createOutputFile(llvm::StringRef OutputPath,
OutFile = "-";
}
- llvm::raw_fd_ostream *OS =
+ llvm::OwningPtr<llvm::raw_fd_ostream> OS(
new llvm::raw_fd_ostream(OutFile.c_str(), Error,
- (Binary ? llvm::raw_fd_ostream::F_Binary : 0));
- if (!OS)
+ (Binary ? llvm::raw_fd_ostream::F_Binary : 0)));
+ if (!Error.empty())
return 0;
if (ResultPathName)
*ResultPathName = OutFile;
- return OS;
+ return OS.take();
}
// Initialization Utilities
OpenPOWER on IntegriCloud