14 #ifndef LLVM_SUPPORT_FILEOUTPUTBUFFER_H
15 #define LLVM_SUPPORT_FILEOUTPUTBUFFER_H
19 #include "llvm/Support/DataTypes.h"
41 std::unique_ptr<FileOutputBuffer> &Result,
46 return (uint8_t*)
Region->data();
83 std::unique_ptr<llvm::sys::fs::mapped_file_region>
Region;
size_t getBufferSize() const
Returns size of the buffer.
~FileOutputBuffer()
If this object was previously committed, the destructor just deletes this object. ...
FileOutputBuffer - This interface provides simple way to create an in-memory buffer which will be wri...
std::error_code commit()
Flushes the content of the buffer to its file and deallocates the buffer.
static std::error_code create(StringRef FilePath, size_t Size, std::unique_ptr< FileOutputBuffer > &Result, unsigned Flags=0)
Factory method to create an OutputBuffer object which manages a read/write buffer of the specified si...
uint8_t * getBufferEnd()
Returns a pointer to the end of the buffer.
StringRef getPath() const
Returns path where file will show up if buffer is committed.
uint8_t * getBufferStart()
Returns a pointer to the start of the buffer.
StringRef - Represent a constant reference to a string, i.e.