Index: include/llvm/LTO/legacy/ThinLTOCodeGenerator.h =================================================================== --- include/llvm/LTO/legacy/ThinLTOCodeGenerator.h +++ include/llvm/LTO/legacy/ThinLTOCodeGenerator.h @@ -151,8 +151,10 @@ /// 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. 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.