[llvm-commits] CVS: llvm/lib/Bytecode/Reader/ReaderWrappers.cpp

Reid Spencer reid at x10sys.com
Wed Jun 7 16:18:49 PDT 2006

Changes in directory llvm/lib/Bytecode/Reader:

ReaderWrappers.cpp updated: 1.53 -> 1.54
Log message:

For PR787: http://llvm.cs.uiuc.edu/PR787 :
Provide new llvm::sys::Program facilities for converting the stdout and
stdin to binary mode. There is no standard way to do this and the available
mechanisms are platform specific. Adjust the bytecode reader and writer to
use these methods when their input is stdin or output is stdout. THis avoids
the problem with \n writing CRLF to a bytecode file on windows.

Patch Contributed by Michael Smith.

Diffs of the changes:  (+2 -0)

 ReaderWrappers.cpp |    2 ++
 1 files changed, 2 insertions(+)

Index: llvm/lib/Bytecode/Reader/ReaderWrappers.cpp
diff -u llvm/lib/Bytecode/Reader/ReaderWrappers.cpp:1.53 llvm/lib/Bytecode/Reader/ReaderWrappers.cpp:1.54
--- llvm/lib/Bytecode/Reader/ReaderWrappers.cpp:1.53	Mon Dec 26 08:23:22 2005
+++ llvm/lib/Bytecode/Reader/ReaderWrappers.cpp	Wed Jun  7 18:18:33 2006
@@ -19,6 +19,7 @@
 #include "llvm/Instructions.h"
 #include "llvm/ADT/StringExtras.h"
 #include "llvm/System/MappedFile.h"
+#include "llvm/System/Program.h"
 #include <cerrno>
 #include <iostream>
 #include <memory>
@@ -132,6 +133,7 @@
 BytecodeStdinReader::BytecodeStdinReader( BytecodeHandler* H )
   : BytecodeReader(H)
+  sys::Program::ChangeStdinToBinary();
   char Buffer[4096*4];
   // Read in all of the data from stdin, we cannot mmap stdin...

More information about the llvm-commits mailing list