LLVM  8.0.1
Public Member Functions | Static Public Member Functions | Protected Member Functions | List of all members
llvm::msf::WritableMappedBlockStream Class Reference

#include "llvm/DebugInfo/MSF/MappedBlockStream.h"

Inheritance diagram for llvm::msf::WritableMappedBlockStream:
Inheritance graph
[legend]
Collaboration diagram for llvm::msf::WritableMappedBlockStream:
Collaboration graph
[legend]

Public Member Functions

support::endianness getEndian () const override
 
Error readBytes (uint32_t Offset, uint32_t Size, ArrayRef< uint8_t > &Buffer) override
 Given an offset into the stream and a number of bytes, attempt to read the bytes and set the output ArrayRef to point to data owned by the stream. More...
 
Error readLongestContiguousChunk (uint32_t Offset, ArrayRef< uint8_t > &Buffer) override
 Given an offset into the stream, read as much as possible without copying any data. More...
 
uint32_t getLength () override
 Return the number of bytes of data in this stream. More...
 
Error writeBytes (uint32_t Offset, ArrayRef< uint8_t > Buffer) override
 Attempt to write the given bytes into the stream at the desired offset. More...
 
Error commit () override
 For buffered streams, commits changes to the backing store. More...
 
const MSFStreamLayoutgetStreamLayout () const
 
uint32_t getBlockSize () const
 
uint32_t getNumBlocks () const
 
uint32_t getStreamLength () const
 
- Public Member Functions inherited from llvm::WritableBinaryStream
 ~WritableBinaryStream () override=default
 
BinaryStreamFlags getFlags () const override
 Return the properties of this stream. More...
 
- Public Member Functions inherited from llvm::BinaryStream
virtual ~BinaryStream ()=default
 

Static Public Member Functions

static std::unique_ptr< WritableMappedBlockStreamcreateStream (uint32_t BlockSize, const MSFStreamLayout &Layout, WritableBinaryStreamRef MsfData, BumpPtrAllocator &Allocator)
 
static std::unique_ptr< WritableMappedBlockStreamcreateIndexedStream (const MSFLayout &Layout, WritableBinaryStreamRef MsfData, uint32_t StreamIndex, BumpPtrAllocator &Allocator)
 
static std::unique_ptr< WritableMappedBlockStreamcreateDirectoryStream (const MSFLayout &Layout, WritableBinaryStreamRef MsfData, BumpPtrAllocator &Allocator)
 
static std::unique_ptr< WritableMappedBlockStreamcreateFpmStream (const MSFLayout &Layout, WritableBinaryStreamRef MsfData, BumpPtrAllocator &Allocator, bool AltFpm=false)
 

Protected Member Functions

 WritableMappedBlockStream (uint32_t BlockSize, const MSFStreamLayout &StreamLayout, WritableBinaryStreamRef MsfData, BumpPtrAllocator &Allocator)
 
- Protected Member Functions inherited from llvm::WritableBinaryStream
Error checkOffsetForWrite (uint32_t Offset, uint32_t DataSize)
 
- Protected Member Functions inherited from llvm::BinaryStream
Error checkOffsetForRead (uint32_t Offset, uint32_t DataSize)
 

Detailed Description

Definition at line 108 of file MappedBlockStream.h.

Constructor & Destructor Documentation

◆ WritableMappedBlockStream()

WritableMappedBlockStream::WritableMappedBlockStream ( uint32_t  BlockSize,
const MSFStreamLayout StreamLayout,
WritableBinaryStreamRef  MsfData,
BumpPtrAllocator Allocator 
)
protected

Definition at line 311 of file MappedBlockStream.cpp.

Member Function Documentation

◆ commit()

Error WritableMappedBlockStream::commit ( )
overridevirtual

For buffered streams, commits changes to the backing store.

Implements llvm::WritableBinaryStream.

Definition at line 422 of file MappedBlockStream.cpp.

References llvm::WritableBinaryStreamRef::commit().

◆ createDirectoryStream()

std::unique_ptr< WritableMappedBlockStream > WritableMappedBlockStream::createDirectoryStream ( const MSFLayout Layout,
WritableBinaryStreamRef  MsfData,
BumpPtrAllocator Allocator 
)
static

◆ createFpmStream()

std::unique_ptr< WritableMappedBlockStream > WritableMappedBlockStream::createFpmStream ( const MSFLayout Layout,
WritableBinaryStreamRef  MsfData,
BumpPtrAllocator Allocator,
bool  AltFpm = false 
)
static

◆ createIndexedStream()

std::unique_ptr< WritableMappedBlockStream > WritableMappedBlockStream::createIndexedStream ( const MSFLayout Layout,
WritableBinaryStreamRef  MsfData,
uint32_t  StreamIndex,
BumpPtrAllocator Allocator 
)
static

◆ createStream()

std::unique_ptr< WritableMappedBlockStream > WritableMappedBlockStream::createStream ( uint32_t  BlockSize,
const MSFStreamLayout Layout,
WritableBinaryStreamRef  MsfData,
BumpPtrAllocator Allocator 
)
static

Definition at line 318 of file MappedBlockStream.cpp.

References Allocator, and BlockSize.

Referenced by createDirectoryStream(), createFpmStream(), and createIndexedStream().

◆ getBlockSize()

uint32_t llvm::msf::WritableMappedBlockStream::getBlockSize ( ) const
inline

Definition at line 145 of file MappedBlockStream.h.

Referenced by writeBytes().

◆ getEndian()

support::endianness llvm::msf::WritableMappedBlockStream::getEndian ( ) const
inlineoverridevirtual

◆ getLength()

uint32_t WritableMappedBlockStream::getLength ( )
overridevirtual

Return the number of bytes of data in this stream.

Implements llvm::BinaryStream.

Definition at line 384 of file MappedBlockStream.cpp.

References llvm::msf::MappedBlockStream::getLength().

◆ getNumBlocks()

uint32_t llvm::msf::WritableMappedBlockStream::getNumBlocks ( ) const
inline

Definition at line 146 of file MappedBlockStream.h.

◆ getStreamLayout()

const MSFStreamLayout& llvm::msf::WritableMappedBlockStream::getStreamLayout ( ) const
inline

Definition at line 141 of file MappedBlockStream.h.

Referenced by writeBytes().

◆ getStreamLength()

uint32_t llvm::msf::WritableMappedBlockStream::getStreamLength ( ) const
inline

◆ readBytes()

Error WritableMappedBlockStream::readBytes ( uint32_t  Offset,
uint32_t  Size,
ArrayRef< uint8_t > &  Buffer 
)
overridevirtual

Given an offset into the stream and a number of bytes, attempt to read the bytes and set the output ArrayRef to point to data owned by the stream.

Implements llvm::BinaryStream.

Definition at line 374 of file MappedBlockStream.cpp.

References llvm::msf::MappedBlockStream::readBytes().

◆ readLongestContiguousChunk()

Error WritableMappedBlockStream::readLongestContiguousChunk ( uint32_t  Offset,
ArrayRef< uint8_t > &  Buffer 
)
overridevirtual

Given an offset into the stream, read as much as possible without copying any data.

Implements llvm::BinaryStream.

Definition at line 379 of file MappedBlockStream.cpp.

References llvm::msf::MappedBlockStream::readLongestContiguousChunk().

◆ writeBytes()

Error WritableMappedBlockStream::writeBytes ( uint32_t  Offset,
ArrayRef< uint8_t >  Data 
)
overridevirtual

Attempt to write the given bytes into the stream at the desired offset.

This will always necessitate a copy. Cannot shrink or grow the stream, only writes into existing allocated space.

Implements llvm::WritableBinaryStream.

Definition at line 388 of file MappedBlockStream.cpp.

References llvm::msf::MSFStreamLayout::Blocks, llvm::msf::blockToOffset(), llvm::WritableBinaryStream::checkOffsetForWrite(), llvm::ArrayRef< T >::data(), getBlockSize(), getStreamLayout(), llvm::ArrayRef< T >::size(), llvm::Error::success(), and llvm::WritableBinaryStreamRef::writeBytes().


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