diff options
author | Dan Gohman <gohman@apple.com> | 2010-06-24 16:25:50 +0000 |
---|---|---|
committer | Dan Gohman <gohman@apple.com> | 2010-06-24 16:25:50 +0000 |
commit | 60e6f3d4123a01babeb2c1a0e00d0a2b109008e5 (patch) | |
tree | 4bc3b68943635f63f61948b5519afca6240213d2 /include/llvm/Support/MemoryBuffer.h | |
parent | 8df08017d81ef3749acdc3234e3f33c15a6d0def (diff) |
Add overloads for getFile and getFileOrSTDIN which take a const char *
instead of a StringRef, avoiding the need to copy the string in the
common case.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@106754 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/Support/MemoryBuffer.h')
-rw-r--r-- | include/llvm/Support/MemoryBuffer.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/include/llvm/Support/MemoryBuffer.h b/include/llvm/Support/MemoryBuffer.h index 0b6cd12f6f..34afd73d65 100644 --- a/include/llvm/Support/MemoryBuffer.h +++ b/include/llvm/Support/MemoryBuffer.h @@ -67,6 +67,10 @@ public: std::string *ErrStr = 0, int64_t FileSize = -1, struct stat *FileInfo = 0); + static MemoryBuffer *getFile(const char *Filename, + std::string *ErrStr = 0, + int64_t FileSize = -1, + struct stat *FileInfo = 0); /// getMemBuffer - Open the specified memory range as a MemoryBuffer. Note /// that EndPtr[0] must be a null byte and be accessible! @@ -105,6 +109,10 @@ public: std::string *ErrStr = 0, int64_t FileSize = -1, struct stat *FileInfo = 0); + static MemoryBuffer *getFileOrSTDIN(const char *Filename, + std::string *ErrStr = 0, + int64_t FileSize = -1, + struct stat *FileInfo = 0); }; } // end namespace llvm |