diff options
| author | Chris Lattner <sabre@nondot.org> | 2007-11-18 18:52:28 +0000 |
|---|---|---|
| committer | Chris Lattner <sabre@nondot.org> | 2007-11-18 18:52:28 +0000 |
| commit | e098a64cb7453717d85e63b76cfca71b78784241 (patch) | |
| tree | 63117495794002fdbca55b298053fb06928e6866 /include/llvm/Support | |
| parent | bc04457894af10abf0e3c975553cf6ed7ba0961b (diff) | |
| download | external_llvm-e098a64cb7453717d85e63b76cfca71b78784241.zip external_llvm-e098a64cb7453717d85e63b76cfca71b78784241.tar.gz external_llvm-e098a64cb7453717d85e63b76cfca71b78784241.tar.bz2 | |
Fix the Linker testcase regressions, by making MemoryBuffer::getFileOrSTDIN return
a valid but empty buffer if stdin is empty.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44219 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/Support')
| -rw-r--r-- | include/llvm/Support/MemoryBuffer.h | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/include/llvm/Support/MemoryBuffer.h b/include/llvm/Support/MemoryBuffer.h index aa13bfc..cfef6b1 100644 --- a/include/llvm/Support/MemoryBuffer.h +++ b/include/llvm/Support/MemoryBuffer.h @@ -88,14 +88,11 @@ public: /// getFileOrSTDIN - Open the specified file as a MemoryBuffer, or open stdin /// if the Filename is "-". If an error occurs, this returns null and fills - /// in *ErrStr with a reason. + /// in *ErrStr with a reason. If stdin is empty, this API (unlike getSTDIN) + /// returns an empty buffer. static MemoryBuffer *getFileOrSTDIN(const char *FilenameStart,unsigned FnSize, std::string *ErrStr = 0, - int64_t FileSize = -1) { - if (FnSize == 1 && FilenameStart[0] == '-') - return getSTDIN(); - return getFile(FilenameStart, FnSize, ErrStr, FileSize); - } + int64_t FileSize = -1); /// getFileOrSTDIN - Open the specified file as a MemoryBuffer, or open stdin /// if the Filename is "-". If an error occurs, this returns null and fills |
