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

MappedBlockStream represents data stored in an MSF file into chunks of a particular size (called the Block Size), and whose chunks may not be necessarily contiguous. More...

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

Inheritance diagram for llvm::msf::MappedBlockStream:
Inheritance graph
[legend]
Collaboration diagram for llvm::msf::MappedBlockStream:
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...
 
BumpPtrAllocatorgetAllocator ()
 
void invalidateCache ()
 
uint32_t getBlockSize () const
 
uint32_t getNumBlocks () const
 
uint32_t getStreamLength () const
 
- Public Member Functions inherited from llvm::BinaryStream
virtual ~BinaryStream ()=default
 
virtual BinaryStreamFlags getFlags () const
 Return the properties of this stream. More...
 

Static Public Member Functions

static std::unique_ptr< MappedBlockStreamcreateStream (uint32_t BlockSize, const MSFStreamLayout &Layout, BinaryStreamRef MsfData, BumpPtrAllocator &Allocator)
 
static std::unique_ptr< MappedBlockStreamcreateIndexedStream (const MSFLayout &Layout, BinaryStreamRef MsfData, uint32_t StreamIndex, BumpPtrAllocator &Allocator)
 
static std::unique_ptr< MappedBlockStreamcreateFpmStream (const MSFLayout &Layout, BinaryStreamRef MsfData, BumpPtrAllocator &Allocator)
 
static std::unique_ptr< MappedBlockStreamcreateDirectoryStream (const MSFLayout &Layout, BinaryStreamRef MsfData, BumpPtrAllocator &Allocator)
 

Protected Member Functions

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

Friends

class WritableMappedBlockStream
 

Detailed Description

MappedBlockStream represents data stored in an MSF file into chunks of a particular size (called the Block Size), and whose chunks may not be necessarily contiguous.

The arrangement of these chunks MSF the file is described by some other metadata contained within the MSF file. In the case of a standard MSF Stream, the layout of the stream's blocks is described by the MSF "directory", but in the case of the directory itself, the layout is described by an array at a fixed location within the MSF. MappedBlockStream provides methods for reading from and writing to one of these streams transparently, as if it were a contiguous sequence of bytes.

Definition at line 40 of file MappedBlockStream.h.

Constructor & Destructor Documentation

◆ MappedBlockStream()

MappedBlockStream::MappedBlockStream ( uint32_t  BlockSize,
const MSFStreamLayout StreamLayout,
BinaryStreamRef  MsfData,
BumpPtrAllocator Allocator 
)
protected

Definition at line 46 of file MappedBlockStream.cpp.

Referenced by getStreamLength().

Member Function Documentation

◆ createDirectoryStream()

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

◆ createFpmStream()

std::unique_ptr< MappedBlockStream > MappedBlockStream::createFpmStream ( const MSFLayout Layout,
BinaryStreamRef  MsfData,
BumpPtrAllocator Allocator 
)
static

◆ createIndexedStream()

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

◆ createStream()

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

Definition at line 53 of file MappedBlockStream.cpp.

Referenced by createDirectoryStream(), and createFpmStream().

◆ getAllocator()

BumpPtrAllocator& llvm::msf::MappedBlockStream::getAllocator ( )
inline

Definition at line 71 of file MappedBlockStream.h.

References Allocator, and invalidateCache().

◆ getBlockSize()

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

Definition at line 75 of file MappedBlockStream.h.

References BlockSize.

◆ getEndian()

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

◆ getLength()

uint32_t MappedBlockStream::getLength ( )
overridevirtual

◆ getNumBlocks()

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

Definition at line 76 of file MappedBlockStream.h.

References llvm::msf::MSFStreamLayout::Blocks.

Referenced by readLongestContiguousChunk().

◆ getStreamLength()

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

◆ invalidateCache()

void MappedBlockStream::invalidateCache ( )

Definition at line 273 of file MappedBlockStream.cpp.

References llvm::Data, and llvm::ArrayRef< T >::size().

Referenced by getAllocator().

◆ readBytes()

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

◆ readLongestContiguousChunk()

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

Friends And Related Function Documentation

◆ WritableMappedBlockStream

friend class WritableMappedBlockStream
friend

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