diff options
author | Dan Gohman <gohman@apple.com> | 2008-08-21 15:33:45 +0000 |
---|---|---|
committer | Dan Gohman <gohman@apple.com> | 2008-08-21 15:33:45 +0000 |
commit | de20df842e90227f89a3b80561b5c4a5cc9d58b1 (patch) | |
tree | 5a18e8ff35d13a6594fd42c8ca179d4029859ff1 /tools/lto | |
parent | 0768ef6a007af9fa2d47404ea540be5e35bbd52e (diff) | |
download | external_llvm-de20df842e90227f89a3b80561b5c4a5cc9d58b1.zip external_llvm-de20df842e90227f89a3b80561b5c4a5cc9d58b1.tar.gz external_llvm-de20df842e90227f89a3b80561b5c4a5cc9d58b1.tar.bz2 |
Don't silently ignore errors when opening output streams.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55120 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'tools/lto')
-rw-r--r-- | tools/lto/LTOCodeGenerator.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/tools/lto/LTOCodeGenerator.cpp b/tools/lto/LTOCodeGenerator.cpp index 275aac2..c035be9 100644 --- a/tools/lto/LTOCodeGenerator.cpp +++ b/tools/lto/LTOCodeGenerator.cpp @@ -163,10 +163,11 @@ const void* LTOCodeGenerator::compile(size_t* length, std::string& errMsg) sys::RemoveFileOnSignal(uniqueAsmPath); // generate assembly code - std::string error; bool genResult = false; { - raw_fd_ostream asmFile(uniqueAsmPath.c_str(), error); + raw_fd_ostream asmFile(uniqueAsmPath.c_str(), errMsg); + if (!errMsg.empty()) + return NULL; genResult = this->generateAssemblyCode(asmFile, errMsg); } if ( genResult ) { |