aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2008-04-01 18:04:03 +0000
committerChris Lattner <sabre@nondot.org>2008-04-01 18:04:03 +0000
commit038112a4e0a9afd656f415ab397a230ae5921627 (patch)
tree1e533932de12cd50bf288f55438475ed736bdce8 /include
parent8eedc9ee2ca3bb489957de68e3f907c88ca39efc (diff)
Change the MemoryBuffer::getFile* methods to take just a pointer to the
start of a filename, not a filename+length. All clients can produce a null terminated name, and the system api's require null terminated strings anyway. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@49041 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include')
-rw-r--r--include/llvm/Support/MemoryBuffer.h6
1 files changed, 3 insertions, 3 deletions
diff --git a/include/llvm/Support/MemoryBuffer.h b/include/llvm/Support/MemoryBuffer.h
index ffe1bf6d2f..8c36791be5 100644
--- a/include/llvm/Support/MemoryBuffer.h
+++ b/include/llvm/Support/MemoryBuffer.h
@@ -52,7 +52,7 @@ public:
/// MemoryBuffer if successful, otherwise returning null. If FileSize is
/// specified, this means that the client knows that the file exists and that
/// it has the specified size.
- static MemoryBuffer *getFile(const char *FilenameStart, unsigned FnSize,
+ static MemoryBuffer *getFile(const char *Filename,
std::string *ErrStr = 0,
int64_t FileSize = -1);
@@ -90,7 +90,7 @@ public:
/// 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.
- static MemoryBuffer *getFileOrSTDIN(const char *FilenameStart,unsigned FnSize,
+ static MemoryBuffer *getFileOrSTDIN(const char *Filename,
std::string *ErrStr = 0,
int64_t FileSize = -1);
@@ -100,7 +100,7 @@ public:
static MemoryBuffer *getFileOrSTDIN(const std::string &FN,
std::string *ErrStr = 0,
int64_t FileSize = -1) {
- return getFileOrSTDIN(&FN[0], FN.size(), ErrStr, FileSize);
+ return getFileOrSTDIN(FN.c_str(), ErrStr, FileSize);
}
};