Skip to content
Snippets Groups Projects
Commit e2e9d8e6 authored by Daniel Dunbar's avatar Daniel Dunbar
Browse files

Make sure to set stdout to binary when writing bitcode files via

std::ostream API.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58042 91177308-0d34-0410-b5e6-96231b3b80d8
parent ee4c619b
No related merge requests found
......@@ -1332,6 +1332,9 @@ static void EmitDarwinBCTrailer(BitstreamWriter &Stream, unsigned BufferSize) {
/// stream.
void llvm::WriteBitcodeToFile(const Module *M, std::ostream &Out) {
raw_os_ostream RawOut(Out);
// If writing to stdout, set binary mode.
if (llvm::cout == Out)
sys::Program::ChangeStdoutToBinary();
WriteBitcodeToFile(M, RawOut);
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment