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) { + typedef decltype(CacheOptions.Policy.Interval) chrono_type; if (Interval) - CacheOptions.Policy.Interval = std::chrono::seconds(Interval); + CacheOptions.Policy.Interval = + Interval > 0 ? chrono_type(Interval) : chrono_type::max(); } /// Cache policy: expiration (in seconds) for an entry.