mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-08-17 05:29:24 +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.
|
/// stream.
|
||||||
void llvm::WriteBitcodeToFile(const Module *M, std::ostream &Out) {
|
void llvm::WriteBitcodeToFile(const Module *M, std::ostream &Out) {
|
||||||
raw_os_ostream RawOut(Out);
|
raw_os_ostream RawOut(Out);
|
||||||
|
// If writing to stdout, set binary mode.
|
||||||
|
if (llvm::cout == Out)
|
||||||
|
sys::Program::ChangeStdoutToBinary();
|
||||||
WriteBitcodeToFile(M, RawOut);
|
WriteBitcodeToFile(M, RawOut);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user