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