LLVM 20.0.0git
|
#include "llvm/DebugInfo/MSF/MappedBlockStream.h"
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 | |
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< 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) |
Definition at line 105 of file MappedBlockStream.h.
|
protected |
Definition at line 308 of file MappedBlockStream.cpp.
References Allocator.
|
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().
|
static |
Definition at line 336 of file MappedBlockStream.cpp.
References Allocator, llvm::msf::MSFStreamLayout::Blocks, llvm::msf::SuperBlock::BlockSize, createStream(), llvm::msf::MSFLayout::DirectoryBlocks, llvm::msf::MSFStreamLayout::Length, llvm::msf::SuperBlock::NumDirectoryBytes, and llvm::msf::MSFLayout::SB.
Referenced by llvm::msf::MSFBuilder::commit().
|
static |
Definition at line 346 of file MappedBlockStream.cpp.
References Allocator, llvm::msf::SuperBlock::BlockSize, llvm::BinaryStreamWriter::bytesRemaining(), llvm::cantFail(), createStream(), llvm::msf::getFpmStreamLayout(), llvm::msf::MSFLayout::SB, and llvm::BinaryStreamWriter::writeBytes().
Referenced by commitFpm().
|
static |
Definition at line 324 of file MappedBlockStream.cpp.
References Allocator, assert(), llvm::msf::MSFStreamLayout::Blocks, llvm::msf::SuperBlock::BlockSize, createStream(), llvm::msf::MSFStreamLayout::Length, llvm::msf::MSFLayout::SB, llvm::msf::MSFLayout::StreamMap, and llvm::msf::MSFLayout::StreamSizes.
Referenced by llvm::pdb::GSIStreamBuilder::commit(), llvm::pdb::TpiStreamBuilder::commit(), llvm::pdb::InfoStreamBuilder::commit(), llvm::pdb::DbiStreamBuilder::commit(), llvm::pdb::PDBFileBuilder::commit(), and llvm::pdb::DbiModuleDescriptorBuilder::commitSymbolStream().
|
static |
Definition at line 315 of file MappedBlockStream.cpp.
References Allocator, and BlockSize.
Referenced by createDirectoryStream(), createFpmStream(), and createIndexedStream().
|
inline |
Definition at line 142 of file MappedBlockStream.h.
References llvm::msf::MappedBlockStream::getBlockSize().
Referenced by writeBytes().
|
inlineoverridevirtual |
Implements llvm::BinaryStream.
Definition at line 124 of file MappedBlockStream.h.
References llvm::little.
|
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().
|
inline |
Definition at line 143 of file MappedBlockStream.h.
References llvm::msf::MappedBlockStream::getNumBlocks().
|
inline |
Definition at line 138 of file MappedBlockStream.h.
Referenced by writeBytes().
|
inline |
Definition at line 144 of file MappedBlockStream.h.
References llvm::msf::MappedBlockStream::getStreamLength().
|
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.
|
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().
|
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().