From 60e6f3d4123a01babeb2c1a0e00d0a2b109008e5 Mon Sep 17 00:00:00 2001 From: Dan Gohman Date: Thu, 24 Jun 2010 16:25:50 +0000 Subject: 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 --- include/llvm/Support/MemoryBuffer.h | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'include/llvm') 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 -- cgit v1.2.3