14#ifndef LLVM_SUPPORT_CACHEPRUNING_H
15#define LLVM_SUPPORT_CACHEPRUNING_H
23template <
typename T>
class Expected;
33 std::optional<std::chrono::seconds>
Interval = std::chrono::seconds(1200);
38 std::chrono::seconds
Expiration = std::chrono::hours(7 * 24);
83 const std::vector<std::unique_ptr<MemoryBuffer>> &Files = {});
std::pair< uint64_t, uint64_t > Interval
Tagged union holding either a T or a Error.
StringRef - Represent a constant reference to a string, i.e.
This is an optimization pass for GlobalISel generic memory operations.
Expected< CachePruningPolicy > parseCachePruningPolicy(StringRef PolicyStr)
Parse the given string as a cache pruning policy.
bool pruneCache(StringRef Path, CachePruningPolicy Policy, const std::vector< std::unique_ptr< MemoryBuffer > > &Files={})
Peform pruning using the supplied policy, returns true if pruning occurred, i.e.
Policy for the pruneCache() function.
uint64_t MaxSizeFiles
The maximum number of files in the cache directory.
std::chrono::seconds Expiration
The expiration for a file.
uint64_t MaxSizeBytes
The maximum size for the cache directory in bytes.
unsigned MaxSizePercentageOfAvailableSpace
The maximum size for the cache directory, in terms of percentage of the available space on the disk.