mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-12-26 13:36:28 +00:00
Turn stdout into binary mode during bitcode emission.
This is necessary on windows targets, since stdout is in text mode there. Patch by Julien Lerouge! llvm-svn: 52038
This commit is contained in:
parent
3e9eeaf6c9
commit
b207a716ee
@ -23,6 +23,7 @@
|
||||
#include "llvm/TypeSymbolTable.h"
|
||||
#include "llvm/ValueSymbolTable.h"
|
||||
#include "llvm/Support/MathExtras.h"
|
||||
#include "llvm/System/Program.h"
|
||||
using namespace llvm;
|
||||
|
||||
/// These are manifest constants used by the bitcode writer. They do not need to
|
||||
@ -1292,6 +1293,10 @@ void llvm::WriteBitcodeToFile(const Module *M, std::ostream &Out) {
|
||||
// Emit the module.
|
||||
WriteModule(M, Stream);
|
||||
|
||||
// If writing to stdout, set binary mode.
|
||||
if (llvm::cout == Out)
|
||||
sys::Program::ChangeStdoutToBinary();
|
||||
|
||||
// Write the generated bitstream to "Out".
|
||||
Out.write((char*)&Buffer.front(), Buffer.size());
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user