mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-11-02 07:17:36 +00:00
[Support] Add MemoryBuffer::getFileSlice()
mach-o supports "fat" files which are a header/table-of-contents followed by a concatenation of mach-o files built for different architectures. Currently, MemoryBuffer has no easy way to map a subrange (slice) of a file which lld will need to select a mach-o slice of a fat file. The new function provides an easy way to map a slice of a file into a MemoryBuffer. Test case included. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219260 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -126,6 +126,10 @@ public:
|
||||
static ErrorOr<std::unique_ptr<MemoryBuffer>>
|
||||
getFileOrSTDIN(const Twine &Filename, int64_t FileSize = -1);
|
||||
|
||||
/// Map a subrange of the the specified file as a MemoryBuffer.
|
||||
static ErrorOr<std::unique_ptr<MemoryBuffer>>
|
||||
getFileSlice(const Twine &Filename, uint64_t MapSize, uint64_t Offset);
|
||||
|
||||
//===--------------------------------------------------------------------===//
|
||||
// Provided for performance analysis.
|
||||
//===--------------------------------------------------------------------===//
|
||||
|
||||
Reference in New Issue
Block a user