17#ifndef LLVM_CAS_ONDISKDATAALLOCATOR_H
18#define LLVM_CAS_ONDISKDATAALLOCATOR_H
39 assert(Offset &&
"Null dereference");
43 assert(Offset &&
"Null dereference");
52 : Offset(Offset), Value(Value) {}
74 std::optional<uint64_t> NewFileInitialSize,
90 std::unique_ptr<ImplType> Impl;
assert(UImm &&(UImm !=~static_cast< T >(0)) &&"Invalid immediate!")
This file declares interface for FileOffset that represent stored data at an offset from the beginnin...
Tagged union holding either a T or a Error.
MutableArrayRef - Represent a mutable reference to an array (0 or more elements consecutively in memo...
Twine - A lightweight data structure for efficiently representing the concatenation of temporary valu...
LLVM Value Representation.
FileOffset is a wrapper around uint64_t to represent the offset of data from the beginning of the fil...
const ValueProxy & operator*() const
const ValueProxy * operator->() const
friend class OnDiskDataAllocator
FileOffset getOffset() const
Expected< OnDiskPtr > allocate(size_t Size)
Allocate at least Size with 8-byte alignment.
OnDiskDataAllocator & operator=(const OnDiskDataAllocator &)=delete
Expected< ArrayRef< char > > get(FileOffset Offset, size_t Size) const
Get the data of Size stored at the given Offset.
static Expected< OnDiskDataAllocator > create(const Twine &Path, const Twine &TableName, uint64_t MaxFileSize, std::optional< uint64_t > NewFileInitialSize, uint32_t UserHeaderSize=0, function_ref< void(void *)> UserHeaderInit=nullptr)
MutableArrayRef< char > ValueProxy
OnDiskDataAllocator & operator=(OnDiskDataAllocator &&RHS)
OnDiskDataAllocator(OnDiskDataAllocator &&RHS)
OnDiskDataAllocator(const OnDiskDataAllocator &)=delete
MutableArrayRef< uint8_t > getUserHeader()
An efficient, type-erasing, non-owning reference to a callable.