mirror of
https://github.com/RPCS3/llvm.git
synced 2025-01-20 08:54:08 +00:00
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
This commit is contained in:
parent
ee4c619b3b
commit
e2e9d8e6aa
@ -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…
x
Reference in New Issue
Block a user