LLVM 22.0.0git
|
A cache from a key (that describes an action) to the result of performing that action. More...
#include "llvm/CAS/ActionCache.h"
Public Member Functions | |
Expected< std::optional< CASID > > | get (const CacheKey &ActionKey, bool CanBeDistributed=false) const |
Get a previously computed result for ActionKey . | |
Error | put (const CacheKey &ActionKey, const CASID &Result, bool CanBeDistributed=false) |
Cache Result for the ActionKey computation. | |
virtual | ~ActionCache ()=default |
Protected Member Functions | |
virtual Expected< std::optional< CASID > > | getImpl (ArrayRef< uint8_t > ResolvedKey, bool CanBeDistributed) const =0 |
virtual Error | putImpl (ArrayRef< uint8_t > ResolvedKey, const CASID &Result, bool CanBeDistributed)=0 |
ActionCache (const CASContext &Context) | |
const CASContext & | getContext () const |
A cache from a key (that describes an action) to the result of performing that action.
Actions are expected to be pure. Storing mappings from one action to multiple results will result in error (cache poisoning).
Definition at line 49 of file ActionCache.h.
|
virtualdefault |
|
inlineprotected |
Definition at line 89 of file ActionCache.h.
|
inline |
Get a previously computed result for ActionKey
.
CanBeDistributed | is a hint to the underlying implementation that if it is true, the lookup is profitable to be done on a distributed caching level, not just locally. The implementation is free to ignore this flag. |
Definition at line 58 of file ActionCache.h.
References llvm::arrayRefFromStringRef(), getImpl(), and llvm::cas::CacheKey::getKey().
|
inlineprotected |
Definition at line 91 of file ActionCache.h.
Referenced by put().
|
protectedpure virtual |
Referenced by get().
|
inline |
Cache Result
for the ActionKey
computation.
CanBeDistributed | is a hint to the underlying implementation that if it is true, the association is profitable to be done on a distributed caching level, not just locally. The implementation is free to ignore this flag. |
Definition at line 69 of file ActionCache.h.
References llvm::arrayRefFromStringRef(), assert(), getContext(), llvm::cas::CacheKey::getKey(), and putImpl().
|
protectedpure virtual |
Referenced by put().