| static LLVM_ABI ErrorOr< std::unique_ptr< WritableMemoryBuffer > > |
getFile (const Twine &Filename, bool IsVolatile=false, std::optional< Align > Alignment=std::nullopt) |
| static LLVM_ABI ErrorOr< std::unique_ptr< WritableMemoryBuffer > > |
getFileSlice (const Twine &Filename, uint64_t MapSize, uint64_t Offset, bool IsVolatile=false, std::optional< Align > Alignment=std::nullopt) |
|
Map a subrange of the specified file as a WritableMemoryBuffer. |
| static LLVM_ABI std::unique_ptr< WritableMemoryBuffer > |
getNewUninitMemBuffer (size_t Size, const Twine &BufferName="", std::optional< Align > Alignment=std::nullopt) |
|
Allocate a new MemoryBuffer of the specified size that is not initialized. |
| static LLVM_ABI std::unique_ptr< WritableMemoryBuffer > |
getNewMemBuffer (size_t Size, const Twine &BufferName="") |
|
Allocate a new zero-initialized MemoryBuffer of the specified size. |
| Static Public Member Functions inherited from llvm::MemoryBuffer |
|
| static ErrorOr< std::unique_ptr< MemoryBuffer > > |
getFile (const Twine &Filename, bool IsText=false, bool RequiresNullTerminator=true, bool IsVolatile=false, std::optional< Align > Alignment=std::nullopt) |
|
Open the specified file as a MemoryBuffer, returning a new MemoryBuffer if successful, otherwise returning null. |
| static ErrorOr< std::unique_ptr< MemoryBuffer > > |
getFileAsStream (const Twine &Filename) |
|
Read all of the specified file into a MemoryBuffer as a stream (i.e. |
| static ErrorOr< std::unique_ptr< MemoryBuffer > > |
getOpenFileSlice (sys::fs::file_t FD, const Twine &Filename, uint64_t MapSize, int64_t Offset, bool IsVolatile=false, std::optional< Align > Alignment=std::nullopt) |
|
Given an already-open file descriptor, map some slice of it into a MemoryBuffer. |
| static ErrorOr< std::unique_ptr< MemoryBuffer > > |
getOpenFile (sys::fs::file_t FD, const Twine &Filename, uint64_t FileSize, bool RequiresNullTerminator=true, bool IsVolatile=false, std::optional< Align > Alignment=std::nullopt) |
|
Given an already-open file descriptor, read the file and return a MemoryBuffer. |
| static std::unique_ptr< MemoryBuffer > |
getMemBuffer (StringRef InputData, StringRef BufferName="", bool RequiresNullTerminator=true) |
|
Open the specified memory range as a MemoryBuffer. |
| static std::unique_ptr< MemoryBuffer > |
getMemBuffer (MemoryBufferRef Ref, bool RequiresNullTerminator=true) |
| static std::unique_ptr< MemoryBuffer > |
getMemBufferCopy (StringRef InputData, const Twine &BufferName="") |
|
Open the specified memory range as a MemoryBuffer, copying the contents and taking ownership of it. |
| static ErrorOr< std::unique_ptr< MemoryBuffer > > |
getSTDIN () |
|
Read all of stdin into a file buffer, and return it. |
| static ErrorOr< std::unique_ptr< MemoryBuffer > > |
getFileOrSTDIN (const Twine &Filename, bool IsText=false, bool RequiresNullTerminator=true, std::optional< Align > Alignment=std::nullopt) |
|
Open the specified file as a MemoryBuffer, or open stdin if the Filename is "-". |
| static ErrorOr< std::unique_ptr< MemoryBuffer > > |
getFileSlice (const Twine &Filename, uint64_t MapSize, uint64_t Offset, bool IsVolatile=false, std::optional< Align > Alignment=std::nullopt) |
|
Map a subrange of the specified file as a MemoryBuffer. |