LLVM: include/llvm/CAS/OnDiskDataAllocator.h Source File (original) (raw)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17#ifndef LLVM_CAS_ONDISKDATAALLOCATOR_H
18#define LLVM_CAS_ONDISKDATAALLOCATOR_H
19
23
25
26
27
28
30public:
32
33
35 public:
39 assert(Offset && "Null dereference");
40 return Value;
41 }
43 assert(Offset && "Null dereference");
44 return &Value;
45 }
46
48
49 private:
52 : Offset(Offset), Value(Value) {}
55 };
56
57
58
59
61 size_t Size) const;
62
63
65
66
67
69
72
75 std::optional<uint64_t> NewFileInitialSize,
77 function_ref<void(void *)> UserHeaderInit = nullptr);
78
81
82
85
87
88private:
91 std::unique_ptr Impl;
92};
93
94}
95
96#endif
assert(UImm &&(UImm !=~static_cast< T >(0)) &&"Invalid immediate!")
#define LLVM_ABI_FOR_TEST
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
Definition OnDiskDataAllocator.h:38
const ValueProxy * operator->() const
Definition OnDiskDataAllocator.h:42
friend class OnDiskDataAllocator
Definition OnDiskDataAllocator.h:50
FileOffset getOffset() const
Definition OnDiskDataAllocator.h:36
LLVM_ABI_FOR_TEST ~OnDiskDataAllocator()
MutableArrayRef< uint8_t > getUserHeader() const
LLVM_ABI_FOR_TEST Expected< OnDiskPtr > allocate(size_t Size)
Allocate at least Size with 8-byte alignment.
OnDiskDataAllocator & operator=(const OnDiskDataAllocator &)=delete
LLVM_ABI_FOR_TEST Expected< ArrayRef< char > > get(FileOffset Offset, size_t Size) const
Get the data of Size stored at the given Offset.
static LLVM_ABI_FOR_TEST 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)
LLVM_ABI_FOR_TEST size_t size() const
MutableArrayRef< char > ValueProxy
Definition OnDiskDataAllocator.h:31
LLVM_ABI_FOR_TEST OnDiskDataAllocator & operator=(OnDiskDataAllocator &&RHS)
LLVM_ABI_FOR_TEST OnDiskDataAllocator(OnDiskDataAllocator &&RHS)
OnDiskDataAllocator(const OnDiskDataAllocator &)=delete
LLVM_ABI_FOR_TEST size_t capacity() const
An efficient, type-erasing, non-owning reference to a callable.