16#ifndef LLVM_CAS_ONDISKTRIERAWHASHMAP_H
17#define LLVM_CAS_ONDISKTRIERAWHASHMAP_H
91 return Offset.get() < (1LL << 48);
144 using const_pointer::PointerImpl::PointerImpl;
157 using pointer::PointerImpl::PointerImpl;
195 assert(Allocated.Hash == Value.Hash);
196 assert(Allocated.Data.size() == Value.Data.size());
197 llvm::copy(Value.Data, Allocated.Data.begin());
219 std::optional<uint64_t> NewFileInitialSize,
220 std::optional<size_t> NewTableNumRootBits = std::nullopt,
221 std::optional<size_t> NewTableNumSubtrieBits = std::nullopt);
230 std::unique_ptr<ImplType> Impl;
assert(UImm &&(UImm !=~static_cast< T >(0)) &&"Invalid immediate!")
#define LLVM_DUMP_METHOD
Mark debug helper function definitions like dump() that should not be stripped from debug builds.
This file declares interface for FileOffset that represent stored data at an offset from the beginnin...
ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory),...
Lightweight error class with error context and mandatory checking.
Tagged union holding either a T or a Error.
MutableArrayRef - Represent a mutable reference to an array (0 or more elements consecutively in memo...
StringRef - Represent a constant reference to a string, i.e.
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 ProxyT * operator->() const
FileOffset getOffset() const
const ProxyT & operator*() const
PointerImpl(ProxyT Value, FileOffset Offset, bool IsValue=true)
friend class OnDiskTrieRawHashMap
friend class OnDiskTrieRawHashMap
const_pointer find(ArrayRef< uint8_t > Hash) const
Find the value from hash.
OnDiskTrieRawHashMap(OnDiskTrieRawHashMap &&RHS)
Expected< pointer > insertLazy(ArrayRef< uint8_t > Hash, LazyInsertOnConstructCB OnConstruct=nullptr, LazyInsertOnLeakCB OnLeak=nullptr)
Insert lazily.
function_ref< void(FileOffset TentativeOffset, ValueProxy TentativeValue)> LazyInsertOnConstructCB
Error validate(function_ref< Error(FileOffset, ConstValueProxy)> RecordVerifier) const
Validate the trie data structure.
static Expected< OnDiskTrieRawHashMap > create(const Twine &Path, const Twine &TrieName, size_t NumHashBits, uint64_t DataSize, uint64_t MaxFileSize, std::optional< uint64_t > NewFileInitialSize, std::optional< size_t > NewTableNumRootBits=std::nullopt, std::optional< size_t > NewTableNumSubtrieBits=std::nullopt)
Gets or creates a file at Path with a hash-mapped trie named TrieName.
LLVM_DUMP_METHOD void dump() const
Expected< const_pointer > recoverFromFileOffset(FileOffset Offset) const
Helper function to recover a pointer into the trie from file offset.
static bool validOffset(FileOffset Offset)
Check the valid range of file offset for OnDiskTrieRawHashMap.
OnDiskTrieRawHashMap & operator=(OnDiskTrieRawHashMap &&RHS)
Expected< pointer > insert(const ConstValueProxy &Value)
void print(raw_ostream &OS, function_ref< void(ArrayRef< char >)> PrintRecordData=nullptr) const
function_ref< void(FileOffset TentativeOffset, ValueProxy TentativeValue, FileOffset FinalOffset, ValueProxy FinalValue)> LazyInsertOnLeakCB
An efficient, type-erasing, non-owning reference to a callable.
This class implements an extremely fast bulk output stream that can only output to a stream.
This is an optimization pass for GlobalISel generic memory operations.
FunctionAddr VTableAddr uintptr_t uintptr_t DataSize
decltype(auto) get(const PointerIntPair< PointerTy, IntBits, IntType, PtrTraits, Info > &Pair)
Const value proxy to access the records stored in TrieRawHashMap.
ConstValueProxy(ArrayRef< uint8_t > Hash, StringRef Data)
ConstValueProxy(ArrayRef< uint8_t > Hash, ArrayRef< char > Data)
ConstValueProxy()=default
Value proxy to access the records stored in TrieRawHashMap.
ValueProxy(ArrayRef< uint8_t > Hash, MutableArrayRef< char > Data)
MutableArrayRef< char > Data