Make output files binary mode for -emit-llvm-bc

llvm-svn: 45348
This commit is contained in:
Christopher Lamb 2007-12-24 23:49:33 +00:00
parent bccb8c432d
commit 2b84813441
1 changed files with 4 additions and 2 deletions

View File

@ -654,10 +654,12 @@ ASTConsumer *clang::CreateBCWriter(const std::string& InFile,
Path.eraseSuffix(); Path.eraseSuffix();
Path.appendSuffix("bc"); Path.appendSuffix("bc");
FileName = Path.toString(); 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 { } 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); return new BCWriter(Out, Diags, Features);