LLVM 22.0.0git
|
This type represents a file cache system that manages caching of files. More...
#include "llvm/Support/Caching.h"
Public Member Functions | |
FileCache (FileCacheFunction CacheFn, const std::string &DirectoryPath) | |
FileCache ()=default | |
Expected< AddStreamFn > | operator() (unsigned Task, StringRef Key, const Twine &ModuleName) |
const std::string & | getCacheDirectoryPath () const |
bool | isValid () const |
This type represents a file cache system that manages caching of files.
It encapsulates a caching function and the directory path where the cache is stored. To request an item from the cache, pass a unique string as the Key. For hits, the cached file will be added to the link and this function will return AddStreamFn(). For misses, the cache will return a stream callback which must be called at most once to produce content for the stream. The file stream produced by the stream callback will add the file to the link after the stream is written to. ModuleName is the unique module identifier for the bitcode module the cache is being checked for.
Clients generally look like this:
if (AddStreamFn AddStream = Cache(Task, Key, ModuleName)) ProduceContent(AddStream);
CacheDirectoryPath stores the directory path where cached files are kept.
|
inline |
Definition at line 86 of file Caching.h.
References llvm::move().
|
default |
|
inline |
|
inline |
Definition at line 98 of file Caching.h.
Referenced by operator()(), and llvm::cgdata::StreamCacheData::StreamCacheData().
|
inline |
Definition at line 90 of file Caching.h.
References assert(), llvm::InnerAnalysisManagerProxy< AnalysisManagerT, IRUnitT, ExtraArgTs... >::Key, and isValid().