-/// 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. If stdin is empty, this API (unlike getSTDIN)
-/// returns an empty buffer.
-error_code MemoryBuffer::getFileOrSTDIN(StringRef Filename,
- OwningPtr<MemoryBuffer> &result,
- int64_t FileSize) {
- if (Filename == "-")
- return getSTDIN(result);
- return getFile(Filename, result, FileSize);