LLVM 24.0.0git
llvm::msf::WritableMappedBlockStream Class Reference

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

Inheritance diagram for llvm::msf::WritableMappedBlockStream:
[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 MSFStreamLayout & getStreamLayout () 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.
Public Member Functions inherited from llvm::BinaryStream
virtual ~BinaryStream ()=default

Static Public Member Functions

static std::unique_ptr< WritableMappedBlockStream > createStream (uint32_t BlockSize, const MSFStreamLayout &Layout, WritableBinaryStreamRef MsfData, BumpPtrAllocator &Allocator)
static std::unique_ptr< WritableMappedBlockStream > createIndexedStream (const MSFLayout &Layout, WritableBinaryStreamRef MsfData, uint32_t StreamIndex, BumpPtrAllocator &Allocator)
static std::unique_ptr< WritableMappedBlockStream > createDirectoryStream (const MSFLayout &Layout, WritableBinaryStreamRef MsfData, BumpPtrAllocator &Allocator)
static std::unique_ptr< WritableMappedBlockStream > createFpmStream (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 106 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 BlockSize.

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.

◆ createDirectoryStream()

◆ createFpmStream()

◆ createIndexedStream()

◆ 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 BlockSize.

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

◆ getBlockSize()

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

Definition at line 143 of file MappedBlockStream.h.

Referenced by writeBytes().

◆ getEndian()

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

Implements llvm::BinaryStream.

Definition at line 125 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.

◆ getNumBlocks()

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

Definition at line 144 of file MappedBlockStream.h.

◆ getStreamLayout()

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

Definition at line 139 of file MappedBlockStream.h.

Referenced by writeBytes().

◆ getStreamLength()

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

Definition at line 145 of file MappedBlockStream.h.

◆ 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, 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.

◆ 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(), and llvm::Error::success().


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