This type represents a file cache system that manages caching of files.

Synopsis

Declared in <llvm/Support/Caching.h>

struct FileCache;

Description

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);

Member Functions

Name

Description

FileCache [constructor]

Constructors

getCacheDirectoryPath

Return the directory path where cached files are stored.

isValid

Return true if this cache has a valid cache function.

operator()

Look up Key in the cache, returning a stream callback on a miss.

Non-Member Functions

Name

Description

localCache

Create a local file system cache which uses the given cache name, temporary file prefix, cache directory and file callback.

Created with MrDocs