mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-07-25 13:24:46 +00:00
[Support/MemoryBuffer] Introduce a boolean parameter (false by default) 'IsVolatile' for the open file functions.
This provides a hint that the file may be changing often so mmap is avoided. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@208007 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -67,34 +67,46 @@ 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.
|
||||
///
|
||||
/// \param IsVolatile true indicates that the file may be changing often.
|
||||
static error_code getFile(Twine Filename, OwningPtr<MemoryBuffer> &Result,
|
||||
int64_t FileSize = -1,
|
||||
bool RequiresNullTerminator = true);
|
||||
bool RequiresNullTerminator = true,
|
||||
bool IsVolatile = false);
|
||||
static error_code getFile(Twine Filename,
|
||||
std::unique_ptr<MemoryBuffer> &Result,
|
||||
int64_t FileSize = -1,
|
||||
bool RequiresNullTerminator = true);
|
||||
bool RequiresNullTerminator = true,
|
||||
bool IsVolatile = false);
|
||||
|
||||
/// Given an already-open file descriptor, map some slice of it into a
|
||||
/// MemoryBuffer. The slice is specified by an \p Offset and \p MapSize.
|
||||
/// Since this is in the middle of a file, the buffer is not null terminated.
|
||||
///
|
||||
/// \param IsVolatile true indicates that the file may be changing often.
|
||||
static error_code getOpenFileSlice(int FD, const char *Filename,
|
||||
OwningPtr<MemoryBuffer> &Result,
|
||||
uint64_t MapSize, int64_t Offset);
|
||||
uint64_t MapSize, int64_t Offset,
|
||||
bool IsVolatile = false);
|
||||
static error_code getOpenFileSlice(int FD, const char *Filename,
|
||||
std::unique_ptr<MemoryBuffer> &Result,
|
||||
uint64_t MapSize, int64_t Offset);
|
||||
uint64_t MapSize, int64_t Offset,
|
||||
bool IsVolatile = false);
|
||||
|
||||
/// Given an already-open file descriptor, read the file and return a
|
||||
/// MemoryBuffer.
|
||||
///
|
||||
/// \param IsVolatile true indicates that the file may be changing often.
|
||||
static error_code getOpenFile(int FD, const char *Filename,
|
||||
OwningPtr<MemoryBuffer> &Result,
|
||||
uint64_t FileSize,
|
||||
bool RequiresNullTerminator = true);
|
||||
bool RequiresNullTerminator = true,
|
||||
bool IsVolatile = false);
|
||||
static error_code getOpenFile(int FD, const char *Filename,
|
||||
std::unique_ptr<MemoryBuffer> &Result,
|
||||
uint64_t FileSize,
|
||||
bool RequiresNullTerminator = true);
|
||||
bool RequiresNullTerminator = true,
|
||||
bool IsVolatile = false);
|
||||
|
||||
/// getMemBuffer - Open the specified memory range as a MemoryBuffer. Note
|
||||
/// that InputData must be null terminated if RequiresNullTerminator is true.
|
||||
|
Reference in New Issue
Block a user