diff options
-rw-r--r-- | Driver/ASTConsumers.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/Driver/ASTConsumers.cpp b/Driver/ASTConsumers.cpp index f3b595ffb1..9a773b32d9 100644 --- a/Driver/ASTConsumers.cpp +++ b/Driver/ASTConsumers.cpp @@ -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); |