14#ifndef LLVM_SUPPORT_CACHEPRUNING_H
15#define LLVM_SUPPORT_CACHEPRUNING_H
34 std::optional<std::chrono::seconds>
Interval = std::chrono::seconds(1200);
39 std::chrono::seconds
Expiration = std::chrono::hours(7 * 24);
86 const std::vector<std::unique_ptr<MemoryBuffer>> &Files = {});
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.
LLVM_ABI Expected< CachePruningPolicy > parseCachePruningPolicy(StringRef PolicyStr)
Parse the given string as a cache pruning policy.
LLVM_ABI 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::optional< std::chrono::seconds > Interval
The pruning interval.
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.