LLVM 24.0.0git
BuiltinUnifiedCASDatabases.h
Go to the documentation of this file.
1//===----------------------------------------------------------------------===//
2//
3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4// See https://llvm.org/LICENSE.txt for license information.
5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6//
7//===----------------------------------------------------------------------===//
8
9#ifndef LLVM_CAS_BUILTINUNIFIEDCASDATABASES_H
10#define LLVM_CAS_BUILTINUNIFIEDCASDATABASES_H
11
13#include "llvm/Support/Error.h"
14
15namespace llvm::cas {
16
17class ActionCache;
18class ObjectStore;
19
20/// Create on-disk \c ObjectStore and \c ActionCache instances based on
21/// \c ondisk::UnifiedOnDiskCache, with built-in hashing.
23Expected<std::pair<std::unique_ptr<ObjectStore>, std::unique_ptr<ActionCache>>>
25
26/// Validate the builtin on-disk CAS in \p Path in-process, if needed. See
27/// \c ondisk::UnifiedOnDiskCache::validateIfNeeded.
29Expected<ValidationResult>
30validateOnDiskUnifiedCASDatabasesIfNeeded(StringRef Path, bool CheckHash,
31 bool ForceValidation);
32
33/// Recover the builtin on-disk CAS in \p Path after a failed validation. See
34/// \c ondisk::UnifiedOnDiskCache::recover.
36Expected<ValidationResult> recoverOnDiskUnifiedCASDatabases(StringRef Path);
37
38} // namespace llvm::cas
39
40#endif // LLVM_CAS_BUILTINUNIFIEDCASDATABASES_H
#define LLVM_ABI
Definition Compiler.h:215
A cache from a key (that describes an action) to the result of performing that action.
Definition ActionCache.h:49
Content-addressable storage for objects.
Definition ObjectStore.h:94
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,...
LLVM_ABI Expected< ValidationResult > recoverOnDiskUnifiedCASDatabases(StringRef Path)
Recover the builtin on-disk CAS in Path after a failed validation.
LLVM_ABI Expected< ValidationResult > validateOnDiskUnifiedCASDatabasesIfNeeded(StringRef Path, bool CheckHash, bool ForceValidation)
Validate the builtin on-disk CAS in Path in-process, if needed.