[llvm] r198821 - Replace fstream use with raw_fd_ostream.

Lang Hames lhames at gmail.com
Wed Jan 8 16:47:55 PST 2014


Author: lhames
Date: Wed Jan  8 18:47:54 2014
New Revision: 198821

URL: http://llvm.org/viewvc/llvm-project?rev=198821&view=rev
Log:
Replace fstream use with raw_fd_ostream.


Modified:
    llvm/trunk/tools/lli/lli.cpp

Modified: llvm/trunk/tools/lli/lli.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/lli/lli.cpp?rev=198821&r1=198820&r2=198821&view=diff
==============================================================================
--- llvm/trunk/tools/lli/lli.cpp (original)
+++ llvm/trunk/tools/lli/lli.cpp Wed Jan  8 18:47:54 2014
@@ -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();
   }





More information about the llvm-commits mailing list