]> granicus.if.org Git - clang/commitdiff
Make output files binary mode for -emit-llvm-bc
authorChristopher Lamb <christopher.lamb@gmail.com>
Mon, 24 Dec 2007 23:49:33 +0000 (23:49 +0000)
committerChristopher Lamb <christopher.lamb@gmail.com>
Mon, 24 Dec 2007 23:49:33 +0000 (23:49 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@45348 91177308-0d34-0410-b5e6-96231b3b80d8

Driver/ASTConsumers.cpp

index f3b595ffb1b096a676557b0a600438508b72323c..9a773b32d9396cf8fb24dbeb7c91eb5a88097f4c 100644 (file)
@@ -654,10 +654,12 @@ ASTConsumer *clang::CreateBCWriter(const std::string& InFile,
       Path.eraseSuffix();
       Path.appendSuffix("bc");
       FileName = Path.toString();
-      Out = new std::ofstream(FileName.c_str());
+      Out = new std::ofstream(FileName.c_str(), 
+                              std::ios_base::binary|std::ios_base::out);
     }
   } else {
-    Out = new std::ofstream(FileName.c_str());
+    Out = new std::ofstream(FileName.c_str(), 
+                            std::ios_base::binary|std::ios_base::out);
   }
 
   return new BCWriter(Out, Diags, Features);