From 2b84813441cf612e69b0e5aabe80bca7c3bcfc5b Mon Sep 17 00:00:00 2001 From: Christopher Lamb Date: Mon, 24 Dec 2007 23:49:33 +0000 Subject: Make output files binary mode for -emit-llvm-bc llvm-svn: 45348 --- clang/Driver/ASTConsumers.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'clang/Driver/ASTConsumers.cpp') 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); -- cgit v1.2.3