[PATCH] D41231: [Support][CachePruning] Fix regression that prevents disabling of pruning

ben via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Dec 15 03:39:54 PST 2017


bd1976llvm updated this revision to Diff 127093.
bd1976llvm added a comment.

I removed the comment change.

I noticed that a number of comments needed updating and have moved all the comment changes here: https://reviews.llvm.org/D41279.

This patch just fixes the regression.


https://reviews.llvm.org/D41231

Files:
  include/llvm/LTO/legacy/ThinLTOCodeGenerator.h


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.


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D41231.127093.patch
Type: text/x-patch
Size: 784 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20171215/7a43d47b/attachment.bin>


More information about the llvm-commits mailing list