diff options
author | Alexander Kornienko <alexfh@google.com> | 2012-12-11 15:36:31 +0000 |
---|---|---|
committer | Alexander Kornienko <alexfh@google.com> | 2012-12-11 15:36:31 +0000 |
commit | b50a126556a69df0fb68a190afdaf9850410fd4a (patch) | |
tree | 57e2fdf1caf960d8d878e0289f32af6759832b49 /lib/Bitcode/Writer/BitWriter.cpp | |
parent | ccaf20cc53a3dc353f4786b1ebf4ebb3f81d4746 (diff) | |
parent | 1ad9253c9d34ccbce3e7e4ea5d87c266cbf93410 (diff) |
Updating branches/google/testing to r169803
git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/google/testing@169870 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Bitcode/Writer/BitWriter.cpp')
-rw-r--r-- | lib/Bitcode/Writer/BitWriter.cpp | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/lib/Bitcode/Writer/BitWriter.cpp b/lib/Bitcode/Writer/BitWriter.cpp index 4288422463..9f51c35ad9 100644 --- a/lib/Bitcode/Writer/BitWriter.cpp +++ b/lib/Bitcode/Writer/BitWriter.cpp @@ -17,12 +17,11 @@ using namespace llvm; int LLVMWriteBitcodeToFile(LLVMModuleRef M, const char *Path) { std::string ErrorInfo; - raw_fd_ostream OS(Path, ErrorInfo, - raw_fd_ostream::F_Binary); - + raw_fd_ostream OS(Path, ErrorInfo, raw_fd_ostream::F_Binary); + if (!ErrorInfo.empty()) return -1; - + WriteBitcodeToFile(unwrap(M), OS); return 0; } @@ -30,7 +29,7 @@ int LLVMWriteBitcodeToFile(LLVMModuleRef M, const char *Path) { int LLVMWriteBitcodeToFD(LLVMModuleRef M, int FD, int ShouldClose, int Unbuffered) { raw_fd_ostream OS(FD, ShouldClose, Unbuffered); - + WriteBitcodeToFile(unwrap(M), OS); return 0; } |