LLVM  6.0.0svn
Public Member Functions | List of all members
InMemoryBuffer Class Reference
Inheritance diagram for InMemoryBuffer:
Inheritance graph
[legend]
Collaboration diagram for InMemoryBuffer:
Collaboration graph
[legend]

Public Member Functions

 InMemoryBuffer (StringRef Path, MemoryBlock Buf, unsigned Mode)
 
uint8_t * getBufferStart () const override
 Returns a pointer to the start of the buffer. More...
 
uint8_t * getBufferEnd () const override
 Returns a pointer to the end of the buffer. More...
 
size_t getBufferSize () const override
 Returns size of the buffer. More...
 
Error commit () override
 Flushes the content of the buffer to its file and deallocates the buffer. More...
 
- Public Member Functions inherited from llvm::FileOutputBuffer
StringRef getPath () const
 Returns path where file will show up if buffer is committed. More...
 
virtual ~FileOutputBuffer ()
 If this object was previously committed, the destructor just deletes this object. More...
 

Additional Inherited Members

- Public Types inherited from llvm::FileOutputBuffer
enum  { F_executable = 1 }
 
- Static Public Member Functions inherited from llvm::FileOutputBuffer
static Expected< std::unique_ptr< FileOutputBuffer > > create (StringRef FilePath, size_t Size, unsigned Flags=0)
 Factory method to create an OutputBuffer object which manages a read/write buffer of the specified size. More...
 
- Protected Member Functions inherited from llvm::FileOutputBuffer
 FileOutputBuffer (StringRef Path)
 
- Protected Attributes inherited from llvm::FileOutputBuffer
std::string FinalPath
 

Detailed Description

Definition at line 70 of file FileOutputBuffer.cpp.

Constructor & Destructor Documentation

◆ InMemoryBuffer()

InMemoryBuffer::InMemoryBuffer ( StringRef  Path,
MemoryBlock  Buf,
unsigned  Mode 
)
inline

Definition at line 72 of file FileOutputBuffer.cpp.

Member Function Documentation

◆ commit()

Error InMemoryBuffer::commit ( )
inlineoverridevirtual

Flushes the content of the buffer to its file and deallocates the buffer.

If commit() is not called before this object's destructor is called, the file is deleted in the destructor. The optional parameter is used if it turns out you want the file size to be smaller than initially requested.

Implements llvm::FileOutputBuffer.

Definition at line 83 of file FileOutputBuffer.cpp.

References llvm::errorCodeToError(), llvm::sys::fs::F_None, Mode, llvm::sys::fs::openFileForWrite(), and llvm::Error::success().

◆ getBufferEnd()

uint8_t* InMemoryBuffer::getBufferEnd ( ) const
inlineoverridevirtual

Returns a pointer to the end of the buffer.

Implements llvm::FileOutputBuffer.

Definition at line 77 of file FileOutputBuffer.cpp.

◆ getBufferSize()

size_t InMemoryBuffer::getBufferSize ( ) const
inlineoverridevirtual

Returns size of the buffer.

Implements llvm::FileOutputBuffer.

Definition at line 81 of file FileOutputBuffer.cpp.

◆ getBufferStart()

uint8_t* InMemoryBuffer::getBufferStart ( ) const
inlineoverridevirtual

Returns a pointer to the start of the buffer.

Implements llvm::FileOutputBuffer.

Definition at line 75 of file FileOutputBuffer.cpp.


The documentation for this class was generated from the following file: