10 #ifndef LLVM_DEBUGINFO_MSF_MSFBUILDER_H 11 #define LLVM_DEBUGINFO_MSF_MSFBUILDER_H 23 class FileBufferByteStream;
24 class WritableBinaryStream;
126 uint32_t computeDirectoryByteSize()
const;
128 using BlockList = std::vector<uint32_t>;
138 std::vector<uint32_t> DirectoryBlocks;
139 std::vector<std::pair<uint32_t, BlockList>> StreamData;
145 #endif // LLVM_DEBUGINFO_MSF_MSFBUILDER_H void setFreePageMap(uint32_t Fpm)
This class represents lattice values for constants.
Error setBlockMapAddr(uint32_t Addr)
Request the block map to be at a specific block address.
This file defines the MallocAllocator and BumpPtrAllocator interfaces.
Expected< MSFLayout > generateLayout()
Finalize the layout and build the headers and structures that describe the MSF layout and can be writ...
uint32_t getNumFreeBlocks() const
Get the total number of blocks that exist in the MSF file but are not allocated to any valid data...
Tagged union holding either a T or a Error.
Error setDirectoryBlocksHint(ArrayRef< uint32_t > DirBlocks)
uint32_t getNumUsedBlocks() const
Get the total number of blocks that will be allocated to actual data in this MSF file.
MutableArrayRef - Represent a mutable reference to an array (0 or more elements consecutively in memo...
uint32_t getTotalBlockCount() const
Get the total number of blocks in the MSF file.
Allocate memory in an ever growing pool, as if by bump-pointer.
bool isBlockFree(uint32_t Idx) const
Check whether a particular block is allocated or free.
uint32_t getStreamSize(uint32_t StreamIdx) const
Get the size of a stream by index.
Error setStreamSize(uint32_t Idx, uint32_t Size)
Update the size of an existing stream.
Expected< uint32_t > addStream(uint32_t Size, ArrayRef< uint32_t > Blocks)
Add a stream to the MSF file with the given size, occupying the given list of blocks.
Expected< FileBufferByteStream > commit(StringRef Path, MSFLayout &Layout)
Write the MSF layout to the underlying file.
uint32_t getNumStreams() const
Get the total number of streams in the MSF layout.
void setUnknown1(uint32_t Unk1)
ArrayRef< uint32_t > getStreamBlocks(uint32_t StreamIdx) const
Get the list of blocks allocated to a particular stream.
static Expected< MSFBuilder > create(BumpPtrAllocator &Allocator, uint32_t BlockSize, uint32_t MinBlockCount=0, bool CanGrow=true)
Create a new MSFBuilder.
Lightweight error class with error context and mandatory checking.
StringRef - Represent a constant reference to a string, i.e.
BumpPtrAllocator & getAllocator()