summaryrefslogtreecommitdiffstats
path: root/llvm
diff options
context:
space:
mode:
authorRafael Espindola <rafael.espindola@gmail.com>2013-06-20 19:50:39 +0000
committerRafael Espindola <rafael.espindola@gmail.com>2013-06-20 19:50:39 +0000
commit1941b007a254b0aace1d8e4b2c01a84ae3cd9cbe (patch)
treef953b69811137dc10fdde7f99c7ce843b2d1283d /llvm
parentdfb08a2cb800ed70f6f967797a7492f19ad74eff (diff)
downloadbcm5719-llvm-1941b007a254b0aace1d8e4b2c01a84ae3cd9cbe.tar.gz
bcm5719-llvm-1941b007a254b0aace1d8e4b2c01a84ae3cd9cbe.zip
Use a raw_fd_ostream instead of a std::ofstream.
llvm-svn: 184460
Diffstat (limited to 'llvm')
-rw-r--r--llvm/tools/llvm-ar/llvm-ar.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/llvm/tools/llvm-ar/llvm-ar.cpp b/llvm/tools/llvm-ar/llvm-ar.cpp
index 53b2d02c3fd..b1b175f4a7b 100644
--- a/llvm/tools/llvm-ar/llvm-ar.cpp
+++ b/llvm/tools/llvm-ar/llvm-ar.cpp
@@ -25,7 +25,6 @@
#include "llvm/Support/raw_ostream.h"
#include <algorithm>
#include <cstdlib>
-#include <fstream>
#include <memory>
using namespace llvm;
@@ -400,9 +399,11 @@ doExtract(std::string* ErrMsg) {
(std::find(Paths.begin(), Paths.end(), I->getPath()) != Paths.end())) {
// Open up a file stream for writing
- std::ios::openmode io_mode = std::ios::out | std::ios::trunc |
- std::ios::binary;
- std::ofstream file(I->getPath().str().c_str(), io_mode);
+ std::string Err;
+ raw_fd_ostream file(I->getPath().str().c_str(), Err,
+ raw_fd_ostream::F_Binary);
+ if (!Err.empty())
+ fail(Err);
// Get the data and its length
const char* data = reinterpret_cast<const char*>(I->getData());
OpenPOWER on IntegriCloud