summaryrefslogtreecommitdiff
path: root/include/llvm/Support/MemoryBuffer.h
diff options
context:
space:
mode:
authorDan Gohman <gohman@apple.com>2010-05-27 17:31:51 +0000
committerDan Gohman <gohman@apple.com>2010-05-27 17:31:51 +0000
commit30377e780918aacda1befa47054c61b0155c194c (patch)
tree0433fbc0a31e3ee419d7b86770778234d391f787 /include/llvm/Support/MemoryBuffer.h
parent95131fcb671f13b931ea3cbb6bbd3fd735f1c5dc (diff)
downloadllvm-30377e780918aacda1befa47054c61b0155c194c.tar.gz
llvm-30377e780918aacda1befa47054c61b0155c194c.tar.bz2
llvm-30377e780918aacda1befa47054c61b0155c194c.tar.xz
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.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/include/llvm/Support/MemoryBuffer.h b/include/llvm/Support/MemoryBuffer.h
index ef7af69684..38f61935d9 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