diff options
author | Dan Gohman <gohman@apple.com> | 2010-05-27 17:31:51 +0000 |
---|---|---|
committer | Dan Gohman <gohman@apple.com> | 2010-05-27 17:31:51 +0000 |
commit | 30377e780918aacda1befa47054c61b0155c194c (patch) | |
tree | 0433fbc0a31e3ee419d7b86770778234d391f787 /include/llvm/Support/MemoryBuffer.h | |
parent | 95131fcb671f13b931ea3cbb6bbd3fd735f1c5dc (diff) | |
download | external_llvm-30377e780918aacda1befa47054c61b0155c194c.zip external_llvm-30377e780918aacda1befa47054c61b0155c194c.tar.gz external_llvm-30377e780918aacda1befa47054c61b0155c194c.tar.bz2 |
Add basic error checking to MemoryBuffer::getSTDIN.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@104855 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/Support/MemoryBuffer.h')
-rw-r--r-- | include/llvm/Support/MemoryBuffer.h | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/include/llvm/Support/MemoryBuffer.h b/include/llvm/Support/MemoryBuffer.h index ef7af69..38f6193 100644 --- a/include/llvm/Support/MemoryBuffer.h +++ b/include/llvm/Support/MemoryBuffer.h @@ -89,7 +89,8 @@ public: StringRef BufferName = ""); /// getSTDIN - Read all of stdin into a file buffer, and return it. - static MemoryBuffer *getSTDIN(); + /// If an error occurs, this returns null and fills in *ErrStr with a reason. + static MemoryBuffer *getSTDIN(std::string *ErrStr = 0); /// getFileOrSTDIN - Open the specified file as a MemoryBuffer, or open stdin |