Index: include/llvm/LTO/legacy/ThinLTOCodeGenerator.h =================================================================== --- include/llvm/LTO/legacy/ThinLTOCodeGenerator.h +++ include/llvm/LTO/legacy/ThinLTOCodeGenerator.h @@ -149,10 +149,12 @@ void setCacheDir(std::string Path) { CacheOptions.Path = std::move(Path); } /// Cache policy: interval (seconds) between two prune of the cache. Set to a - /// negative value (default) to disable pruning. A value of 0 will be ignored. + /// negative value to disable pruning. A value of 0 will be ignored. void setCachePruningInterval(int Interval) { - if (Interval) - CacheOptions.Policy.Interval = std::chrono::seconds(Interval); + if (Interval) + CacheOptions.Policy.Interval = Interval > 0 + ? std::chrono::seconds(Interval) + : std::chrono::seconds::max(); } /// Cache policy: expiration (in seconds) for an entry.