9#ifndef LLVM_DEBUGINFO_MSF_MAPPEDBLOCKSTREAM_H
10#define LLVM_DEBUGINFO_MSF_MAPPEDBLOCKSTREAM_H
41 static std::unique_ptr<MappedBlockStream>
45 static std::unique_ptr<MappedBlockStream>
49 static std::unique_ptr<MappedBlockStream>
53 static std::unique_ptr<MappedBlockStream>
89 const MSFStreamLayout StreamLayout;
107 static std::unique_ptr<WritableMappedBlockStream>
111 static std::unique_ptr<WritableMappedBlockStream>
115 static std::unique_ptr<WritableMappedBlockStream>
120 static std::unique_ptr<WritableMappedBlockStream>
139 return ReadInterface.getStreamLayout();
This file defines the BumpPtrAllocator interface.
This file defines the DenseMap class.
static const int BlockSize
ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory),...
BinaryStreamRef is to BinaryStream what ArrayRef is to an Array.
An interface for accessing data in a stream-like format, but which discourages copying.
Allocate memory in an ever growing pool, as if by bump-pointer.
Lightweight error class with error context and mandatory checking.
MutableArrayRef - Represent a mutable reference to an array (0 or more elements consecutively in memo...
A BinaryStream which can be read from as well as written to.
Describes the layout of a stream in an MSF layout.
std::vector< support::ulittle32_t > Blocks
MappedBlockStream represents data stored in an MSF file into chunks of a particular size (called the ...
static std::unique_ptr< MappedBlockStream > createIndexedStream(const MSFLayout &Layout, BinaryStreamRef MsfData, uint32_t StreamIndex, BumpPtrAllocator &Allocator)
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 A...
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.
BumpPtrAllocator & getAllocator()
static std::unique_ptr< MappedBlockStream > createStream(uint32_t BlockSize, const MSFStreamLayout &Layout, BinaryStreamRef MsfData, BumpPtrAllocator &Allocator)
llvm::endianness getEndian() const override
uint32_t getStreamLength() const
uint32_t getNumBlocks() const
static std::unique_ptr< MappedBlockStream > createDirectoryStream(const MSFLayout &Layout, BinaryStreamRef MsfData, BumpPtrAllocator &Allocator)
uint32_t getBlockSize() const
static std::unique_ptr< MappedBlockStream > createFpmStream(const MSFLayout &Layout, BinaryStreamRef MsfData, BumpPtrAllocator &Allocator)
uint64_t getLength() override
Return the number of bytes of data in this stream.
static std::unique_ptr< WritableMappedBlockStream > createIndexedStream(const MSFLayout &Layout, WritableBinaryStreamRef MsfData, uint32_t StreamIndex, BumpPtrAllocator &Allocator)
uint32_t getStreamLength() const
static std::unique_ptr< WritableMappedBlockStream > createStream(uint32_t BlockSize, const MSFStreamLayout &Layout, WritableBinaryStreamRef MsfData, BumpPtrAllocator &Allocator)
Error commit() override
For buffered streams, commits changes to the backing store.
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 A...
static std::unique_ptr< WritableMappedBlockStream > createFpmStream(const MSFLayout &Layout, WritableBinaryStreamRef MsfData, BumpPtrAllocator &Allocator, bool AltFpm=false)
static std::unique_ptr< WritableMappedBlockStream > createDirectoryStream(const MSFLayout &Layout, WritableBinaryStreamRef MsfData, BumpPtrAllocator &Allocator)
uint64_t getLength() override
Return the number of bytes of data in this stream.
uint32_t getBlockSize() const
const MSFStreamLayout & getStreamLayout() const
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.
uint32_t getNumBlocks() const
Error writeBytes(uint64_t Offset, ArrayRef< uint8_t > Buffer) override
Attempt to write the given bytes into the stream at the desired offset.
llvm::endianness getEndian() const override
This is an optimization pass for GlobalISel generic memory operations.