Don't special-case stdout in llvm::WriteBitcodeToFile; just consider

it to be the caller's responsibility to provide a stream in binary
mode. This fixes a layering violation and avoids an outs() call.

llvm-svn: 104878
This commit is contained in:
Dan Gohman
2010-05-27 20:06:51 +00:00
parent c8edcb3651
commit d9225cee20
3 changed files with 8 additions and 7 deletions

View File

@@ -1662,10 +1662,6 @@ void llvm::WriteBitcodeToFile(const Module *M, raw_ostream &Out) {
WriteBitcodeToStream( M, Stream );
// If writing to stdout, set binary mode.
if (&llvm::outs() == &Out)
sys::Program::ChangeStdoutToBinary();
// Write the generated bitstream to "Out".
Out.write((char*)&Buffer.front(), Buffer.size());