llvm.org GIT mirror llvm / f9f44f3
Use a raw_fd_ostream instead of a std::ofstream. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@184460 91177308-0d34-0410-b5e6-96231b3b80d8 Rafael Espindola 7 years ago
1 changed file(s) with 5 addition(s) and 4 deletion(s). Raw diff Collapse all Expand all
2424 #include "llvm/Support/raw_ostream.h"
2525 #include
2626 #include
27 #include
2827 #include
2928 using namespace llvm;
3029
399398 (std::find(Paths.begin(), Paths.end(), I->getPath()) != Paths.end())) {
400399
401400 // Open up a file stream for writing
402 std::ios::openmode io_mode = std::ios::out | std::ios::trunc |
403 std::ios::binary;
404 std::ofstream file(I->getPath().str().c_str(), io_mode);
401 std::string Err;
402 raw_fd_ostream file(I->getPath().str().c_str(), Err,
403 raw_fd_ostream::F_Binary);
404 if (!Err.empty())
405 fail(Err);
405406
406407 // Get the data and its length
407408 const char* data = reinterpret_cast(I->getData());