forked from OSchip/llvm-project
Make sure to set stdout to binary when writing bitcode files via
std::ostream API. llvm-svn: 58042
This commit is contained in:
parent
62951678ee
commit
f4be24686f
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue