LLVM: lib/CAS/BuiltinCAS.h Source File (original) (raw)
1
2
3
4
5
6
7
8
9#ifndef LLVM_LIB_CAS_BUILTINCAS_H
10#define LLVM_LIB_CAS_BUILTINCAS_H
11
15
20}
22
23
25public:
27
29
35
41
42
43
44
46
48 bool RequiresNullTerminator) const final {
49
51 }
55
57 return createStringError(std::make_error_code(std::errc::invalid_argument),
58 "unknown object '" + ID.toString() + "'");
59 }
60
62 return createStringError(std::make_error_code(std::errc::invalid_argument),
63 "corrupt object '" + ID.toString() + "'");
64 }
65
67 return createStringError(std::make_error_code(std::errc::invalid_argument),
68 "corrupt storage");
69 }
70
72};
73
74
77
78
79
81 std::shared_ptrondisk::UnifiedOnDiskCache UniDB);
82
83
84
86 std::shared_ptrondisk::UnifiedOnDiskCache UniDB);
87
88
91
92}
93}
94
95#endif
This file contains the declaration of the ObjectStore class.
ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory),...
size_t size() const
size - Get the array size.
Lightweight error class with error context and mandatory checking.
Tagged union holding either a T or a Error.
A wrapper around a string literal that serves as a proxy for constructing global tables of StringRefs...
StringRef - Represent a constant reference to a string, i.e.
A cache from a key (that describes an action) to the result of performing that action.
Unique identifier for a CAS object.
Handle to a loaded object in a ObjectStore instance.
ObjectStore(const CASContext &Context)
CASContext for LLVM builtin CAS using BLAKE3 hash type.
virtual Expected< ObjectRef > storeFromNullTerminatedRegion(ArrayRef< uint8_t > ComputedHash, sys::fs::mapped_file_region Map)
Definition BuiltinCAS.h:37
Error createUnknownObjectError(const CASID &ID) const
Definition BuiltinCAS.h:56
Error createCorruptStorageError() const
Definition BuiltinCAS.h:66
virtual ArrayRef< char > getDataConst(ObjectHandle Node) const =0
Both builtin CAS implementations provide lifetime for free, so this can be const, and readData() and ...
uint64_t getDataSize(ObjectHandle Node) const final
Get the size of some data.
Definition BuiltinCAS.h:52
Error validateObject(const CASID &ID) final
Validate the underlying object referred by CASID.
Expected< CASID > parseID(StringRef Reference) final
Get a CASID from a ID, which should have been generated by CASID::print().
Error createCorruptObjectError(const CASID &ID) const
Definition BuiltinCAS.h:61
Expected< ObjectRef > store(ArrayRef< ObjectRef > Refs, ArrayRef< char > Data) final
Store object into ObjectStore.
ArrayRef< char > getData(ObjectHandle Node, bool RequiresNullTerminator) const final
Definition BuiltinCAS.h:47
virtual Expected< ObjectRef > storeImpl(ArrayRef< uint8_t > ComputedHash, ArrayRef< ObjectRef > Refs, ArrayRef< char > Data)=0
BuiltinCAS()
Definition BuiltinCAS.h:26
A unified CAS nodes and key-value database, using on-disk storage for both.
This class represents a memory mapped file.
unsigned ID
LLVM IR allows to use arbitrary numbers as calling convention identifiers.
constexpr StringLiteral DefaultDirProxy
Definition BuiltinCAS.h:89
std::unique_ptr< ObjectStore > createObjectStoreFromUnifiedOnDiskCache(std::shared_ptr< ondisk::UnifiedOnDiskCache > UniDB)
constexpr StringLiteral DefaultDir
Definition BuiltinCAS.h:90
std::unique_ptr< ActionCache > createActionCacheFromUnifiedOnDiskCache(std::shared_ptr< ondisk::UnifiedOnDiskCache > UniDB)
Expected< std::unique_ptr< ondisk::UnifiedOnDiskCache > > createBuiltinUnifiedOnDiskCache(StringRef Path)
Create a UnifiedOnDiskCache instance that uses BLAKE3 hashing.
Error createStringError(std::error_code EC, char const *Fmt, const Ts &... Vals)
Create formatted StringError object.
FunctionAddr VTableAddr uintptr_t uintptr_t Data
ArrayRef(const T &OneElt) -> ArrayRef< T >