summaryrefslogtreecommitdiff
path: root/include/llvm/Support/MemoryBuffer.h
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2010-03-15 20:32:14 +0000
committerDouglas Gregor <dgregor@apple.com>2010-03-15 20:32:14 +0000
commit1bb30b6f750e2364a68af3b04c76ed26b4f508e8 (patch)
tree74960b9c621aee287e8d6bf0ae47a290bbdf5e86 /include/llvm/Support/MemoryBuffer.h
parent001903485fc78a4ae5f33420b25db73a22bfdf4a (diff)
downloadllvm-1bb30b6f750e2364a68af3b04c76ed26b4f508e8.tar.gz
llvm-1bb30b6f750e2364a68af3b04c76ed26b4f508e8.tar.bz2
llvm-1bb30b6f750e2364a68af3b04c76ed26b4f508e8.tar.xz
Extend MemoryBuffer::getFile() to take an optional "stat" structure
pointer. If given, the structure will be set with the stat information from the file actually read. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98575 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/Support/MemoryBuffer.h')
-rw-r--r--include/llvm/Support/MemoryBuffer.h7
1 files changed, 5 insertions, 2 deletions
diff --git a/include/llvm/Support/MemoryBuffer.h b/include/llvm/Support/MemoryBuffer.h
index 65c7167318..fcea5d20de 100644
--- a/include/llvm/Support/MemoryBuffer.h
+++ b/include/llvm/Support/MemoryBuffer.h
@@ -17,6 +17,7 @@
#include "llvm/ADT/StringRef.h"
#include "llvm/System/DataTypes.h"
#include <string>
+#include <sys/stat.h>
namespace llvm {
@@ -59,7 +60,8 @@ public:
/// it has the specified size.
static MemoryBuffer *getFile(StringRef Filename,
std::string *ErrStr = 0,
- int64_t FileSize = -1);
+ 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!
@@ -95,7 +97,8 @@ public:
/// in *ErrStr with a reason.
static MemoryBuffer *getFileOrSTDIN(StringRef Filename,
std::string *ErrStr = 0,
- int64_t FileSize = -1);
+ int64_t FileSize = -1,
+ struct stat *FileInfo = 0);
};
} // end namespace llvm