diff options
| author | Reid Spencer <rspencer@reidspencer.com> | 2006-06-07 23:18:34 +0000 |
|---|---|---|
| committer | Reid Spencer <rspencer@reidspencer.com> | 2006-06-07 23:18:34 +0000 |
| commit | ab97f22ccc5e6674878c31b003cee81c476b4b13 (patch) | |
| tree | 04fb141aaa4d7717954b4a5eb7a2c7817666a144 /llvm/lib/Bytecode/Reader/ReaderWrappers.cpp | |
| parent | ed95105b457bb9ed21214373374680854e0fe502 (diff) | |
| download | bcm5719-llvm-ab97f22ccc5e6674878c31b003cee81c476b4b13.tar.gz bcm5719-llvm-ab97f22ccc5e6674878c31b003cee81c476b4b13.zip | |
For 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.
llvm-svn: 28722
Diffstat (limited to 'llvm/lib/Bytecode/Reader/ReaderWrappers.cpp')
| -rw-r--r-- | llvm/lib/Bytecode/Reader/ReaderWrappers.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/llvm/lib/Bytecode/Reader/ReaderWrappers.cpp b/llvm/lib/Bytecode/Reader/ReaderWrappers.cpp index 1ea5c0262f1..956d1ede696 100644 --- a/llvm/lib/Bytecode/Reader/ReaderWrappers.cpp +++ b/llvm/lib/Bytecode/Reader/ReaderWrappers.cpp @@ -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 @@ namespace { 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... |

