LLVM: llvm::cas Namespace Reference (original) (raw)

Classes
class ActionCache
A cache from a key (that describes an action) to the result of performing that action. More...
class BuiltinObjectHasher
Hasher for stored objects in builtin CAS. More...
class CacheKey
A key for caching an operation. More...
class CASContext
Context for CAS identifiers. More...
class CASID
Unique identifier for a CAS object. More...
class FileOffset
FileOffset is a wrapper around uint64_t to represent the offset of data from the beginning of the file. More...
class MappedFileRegionArena
Allocator for an owned mapped file region that supports thread-safe and process-safe bump pointer allocation. More...
class ObjectHandle
Handle to a loaded object in a ObjectStore instance. More...
class ObjectProxy
Reference to an abstract hierarchical node, with data and references. More...
class ObjectRef
Reference to an object in an ObjectStore instance. More...
class ObjectStore
Content-addressable storage for objects. More...
class OnDiskDataAllocator
Sink for data. More...
class OnDiskTrieRawHashMap
OnDiskTrieRawHashMap is a persistent trie data structure used as hash maps. More...
class ReferenceBase
Base class for references to things in ObjectStore. More...
Enumerations
enum class ValidationResult { Valid, Recovered, Skipped }
Represents the result of validating the contents using validateOnDiskUnifiedCASDatabasesIfNeeded. More...
Functions
LLVM_ABI std::unique_ptr< ActionCache > createInMemoryActionCache ()
Create an action cache in memory.
LLVM_ABI Expected< std::unique_ptr< ActionCache > > createOnDiskActionCache (StringRef Path)
Create an action cache on disk.
LLVM_ABI Expected< std::pair< std::unique_ptr< ObjectStore >, std::unique_ptr< ActionCache > > > createOnDiskUnifiedCASDatabases (StringRef Path)
Create on-disk ObjectStore and ActionCache instances based on ondisk::UnifiedOnDiskCache, with built-in hashing.
Expected< ValidationResult > validateOnDiskUnifiedCASDatabasesIfNeeded (StringRef Path, bool CheckHash, bool AllowRecovery, bool ForceValidation, std::optional< StringRef > LLVMCasBinaryPath)
Validate the data in Path, if needed to ensure correctness.
LLVM_ABI std::unique_ptr< ObjectStore > createInMemoryCAS ()
Create an in memory CAS.
bool isOnDiskCASEnabled ()
LLVM_ABI Expected< std::unique_ptr< ObjectStore > > createOnDiskCAS (const Twine &Path)
Create a persistent on-disk path at Path.

ValidationResult

Represents the result of validating the contents using validateOnDiskUnifiedCASDatabasesIfNeeded.

Note: invalid results are handled as an [Error](classllvm%5F1%5F1Error.html "Lightweight error class with error context and mandatory checking.").

Enumerator
Valid The data is already valid.
Recovered The data was invalid, but was recovered.
Skipped Validation was skipped, as it was not needed.

Definition at line 29 of file BuiltinUnifiedCASDatabases.h.

createInMemoryActionCache()

std::unique_ptr< ActionCache > llvm::cas::createInMemoryActionCache ( )

createInMemoryCAS()

std::unique_ptr< ObjectStore > llvm::cas::createInMemoryCAS ( )

createOnDiskActionCache()

createOnDiskCAS()

createOnDiskUnifiedCASDatabases()

isOnDiskCASEnabled()

bool llvm::cas::isOnDiskCASEnabled ( )

Returns

true if LLVM_ENABLE_ONDISK_CAS configuration was enabled.

Definition at line 185 of file OnDiskCAS.cpp.

validateOnDiskUnifiedCASDatabasesIfNeeded()

Validate the data in Path, if needed to ensure correctness.

Parameters

Path directory for the on-disk database.
CheckHash Whether to validate hashes match the data.
AllowRecovery Whether to automatically recover from invalid data by marking the files for garbage collection.
ForceValidation Whether to force validation to occur even if it should not be necessary.
LLVMCasBinaryPath If provided, validation is performed out-of-process using the given llvm-cas executable which protects against crashes during validation. Otherwise validation is performed in-process.

Returns

Valid if the data is already valid, Recovered if data was invalid but has been cleared, Skipped if validation is not needed, or an [Error](classllvm%5F1%5F1Error.html "Lightweight error class with error context and mandatory checking.") if validation cannot be performed or if the data is left in an invalid state because AllowRecovery is false.

Definition at line 27 of file BuiltinUnifiedCASDatabases.cpp.

References llvm::createStringError(), llvm::cas::builtin::BuiltinCASContext::getHashName(), llvm::inconvertibleErrorCode(), and llvm::cas::ondisk::UnifiedOnDiskCache::validateIfNeeded().