Perform pruning using the supplied policy, returns true if pruning occurred, i.e. if Policy.Interval was expired.
Synopsis
Declared in <llvm/Support/CachePruning.h>
Expected<bool>
pruneCache(
StringRef Path,
CachePruningPolicy Policy,
std::vector<std::unique_ptr<MemoryBuffer>> const& Files = {});
Description
On failure, it returns an Expected with the Error.
Check whether cache pruning happens using the supplied policy, adds a ThinLTO warning if cache_size_bytes or cache_size_files is too small for the current link job. The warning recommends the user to consider adjusting ‐‐thinlto‐cache‐policy.
As a safeguard against data loss if the user specifies the wrong directory as their cache directory, this function will ignore files not matching the pattern "llvmcache‐*".
Return Value
True if pruning occurred, or an Error on failure.
Parameters
Name |
Description |
Path |
Cache directory to prune. |
Policy |
Pruning policy to apply. |
Files |
Optional buffers from the current job, used to warn when the job exceeds size or file‐count limits. |
Created with MrDocs