15#ifndef LLVM_CAS_ACTIONCACHE_H
16#define LLVM_CAS_ACTIONCACHE_H
50 virtual void anchor();
59 bool CanBeDistributed =
false)
const {
60 return getImpl(arrayRefFromStringRef(ActionKey.
getKey()), CanBeDistributed);
70 bool CanBeDistributed =
false) {
71 assert(Result.getContext().getHashSchemaIdentifier() ==
73 "Hash schema mismatch");
74 return putImpl(arrayRefFromStringRef(ActionKey.
getKey()), Result,
87 bool CanBeDistributed) = 0;
assert(UImm &&(UImm !=~static_cast< T >(0)) &&"Invalid immediate!")
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.
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.
Error put(const CacheKey &ActionKey, const CASID &Result, bool CanBeDistributed=false)
Cache Result for the ActionKey computation.
Expected< std::optional< CASID > > get(const CacheKey &ActionKey, bool CanBeDistributed=false) const
Get a previously computed result for ActionKey.
ActionCache(const CASContext &Context)
virtual Expected< std::optional< CASID > > getImpl(ArrayRef< uint8_t > ResolvedKey, bool CanBeDistributed) const =0
const CASContext & getContext() const
virtual Error putImpl(ArrayRef< uint8_t > ResolvedKey, const CASID &Result, bool CanBeDistributed)=0
virtual ~ActionCache()=default
Context for CAS identifiers.
Unique identifier for a CAS object.
A key for caching an operation.
Reference to an abstract hierarchical node, with data and references.
Reference to an object in an ObjectStore instance.
Content-addressable storage for objects.
std::unique_ptr< ActionCache > createInMemoryActionCache()
Create an action cache in memory.
@ Ref
The access may reference the value stored in memory.