LLVM 19.0.0git
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]

Public Member Functions

llvm::endianness getEndian () const override
 
Error readBytes (uint64_t Offset, uint64_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.
 
Error readLongestContiguousChunk (uint64_t Offset, ArrayRef< uint8_t > &Buffer) override
 Given an offset into the stream, read as much as possible without copying any data.
 
uint64_t getLength () override
 Return the number of bytes of data in this stream.
 
Error writeBytes (uint64_t Offset, ArrayRef< uint8_t > Buffer) override
 Attempt to write the given bytes into the stream at the desired offset.
 
Error commit () override
 For buffered streams, commits changes to the backing store.
 
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
 
virtual Error writeBytes (uint64_t Offset, ArrayRef< uint8_t > Data)=0
 Attempt to write the given bytes into the stream at the desired offset.
 
virtual Error commit ()=0
 For buffered streams, commits changes to the backing store.
 
BinaryStreamFlags getFlags () const override
 Return the properties of this stream.
 
- Public Member Functions inherited from llvm::BinaryStream
virtual ~BinaryStream ()=default
 
virtual llvm::endianness getEndian () const =0
 
virtual Error readBytes (uint64_t Offset, uint64_t Size, ArrayRef< uint8_t > &Buffer)=0
 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.
 
virtual Error readLongestContiguousChunk (uint64_t Offset, ArrayRef< uint8_t > &Buffer)=0
 Given an offset into the stream, read as much as possible without copying any data.
 
virtual uint64_t getLength ()=0
 Return the number of bytes of data in this stream.
 
virtual BinaryStreamFlags getFlags () const
 Return the properties of this stream.
 

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 (uint64_t Offset, uint64_t DataSize)
 
- Protected Member Functions inherited from llvm::BinaryStream
Error checkOffsetForRead (uint64_t Offset, uint64_t DataSize)
 

Detailed Description

Definition at line 105 of file MappedBlockStream.h.

Constructor & Destructor Documentation

◆ WritableMappedBlockStream()

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

Definition at line 308 of file MappedBlockStream.cpp.

References Allocator.

Member Function Documentation

◆ commit()

Error WritableMappedBlockStream::commit ( )
overridevirtual

For buffered streams, commits changes to the backing store.

Implements llvm::WritableBinaryStream.

Definition at line 419 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 315 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 142 of file MappedBlockStream.h.

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

Referenced by writeBytes().

◆ getEndian()

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

Implements llvm::BinaryStream.

Definition at line 124 of file MappedBlockStream.h.

References llvm::little.

◆ getLength()

uint64_t WritableMappedBlockStream::getLength ( )
overridevirtual

Return the number of bytes of data in this stream.

Implements llvm::BinaryStream.

Definition at line 381 of file MappedBlockStream.cpp.

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

◆ getNumBlocks()

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

Definition at line 143 of file MappedBlockStream.h.

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

◆ getStreamLayout()

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

Definition at line 138 of file MappedBlockStream.h.

Referenced by writeBytes().

◆ getStreamLength()

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

◆ readBytes()

Error WritableMappedBlockStream::readBytes ( uint64_t  Offset,
uint64_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 371 of file MappedBlockStream.cpp.

References llvm::Offset, llvm::msf::MappedBlockStream::readBytes(), and Size.

◆ readLongestContiguousChunk()

Error WritableMappedBlockStream::readLongestContiguousChunk ( uint64_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 376 of file MappedBlockStream.cpp.

References llvm::Offset, and llvm::msf::MappedBlockStream::readLongestContiguousChunk().

◆ writeBytes()

Error WritableMappedBlockStream::writeBytes ( uint64_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 385 of file MappedBlockStream.cpp.

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


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