Replace fstream use with raw_fd_ostream.
authorLang Hames <lhames@gmail.com>
Thu, 9 Jan 2014 00:47:54 +0000 (00:47 +0000)
committerLang Hames <lhames@gmail.com>
Thu, 9 Jan 2014 00:47:54 +0000 (00:47 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@198821 91177308-0d34-0410-b5e6-96231b3b80d8

tools/lli/lli.cpp

index 102811fec7ce7efc642d3d975793944eaafffe80..62e232ad68e7e65be15e0440926db0f7c1c5c7af 100644 (file)
@@ -53,7 +53,6 @@
 #include "llvm/Support/raw_ostream.h"
 #include "llvm/Transforms/Instrumentation.h"
 #include <cerrno>
-#include <fstream>
 
 #ifdef __CYGWIN__
 #include <cygwin/version.h>
@@ -255,7 +254,8 @@ public:
     std::string CacheName;
     if (!getCacheFilename(ModuleID, CacheName))
       return;
-    std::ofstream outfile(CacheName.c_str(), std::ofstream::binary);
+    std::string errStr;
+    raw_fd_ostream outfile(CacheName.c_str(), errStr, sys::fs::F_Binary);
     outfile.write(Obj->getBufferStart(), Obj->getBufferSize());
     outfile.close();
   }