summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorDan Gohman <gohman@apple.com>2010-06-24 16:25:50 +0000
committerDan Gohman <gohman@apple.com>2010-06-24 16:25:50 +0000
commit60e6f3d4123a01babeb2c1a0e00d0a2b109008e5 (patch)
tree4bc3b68943635f63f61948b5519afca6240213d2 /include
parent8df08017d81ef3749acdc3234e3f33c15a6d0def (diff)
downloadllvm-60e6f3d4123a01babeb2c1a0e00d0a2b109008e5.tar.gz
llvm-60e6f3d4123a01babeb2c1a0e00d0a2b109008e5.tar.bz2
llvm-60e6f3d4123a01babeb2c1a0e00d0a2b109008e5.tar.xz
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')
-rw-r--r--include/llvm/Support/MemoryBuffer.h8
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