[PATCH] D41497: [ThinLTO][CachePruning] explicitly disable pruning

ben via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Dec 22 10:25:30 PST 2017


bd1976llvm marked 4 inline comments as done.
bd1976llvm added inline comments.


================
Comment at: lib/Support/CachePruning.cpp:170
+      return false;
     if (Policy.Interval != seconds(0)) {
       // Check whether the time stamp is older than our pruning interval.
----------------
tejohnson wrote:
> bd1976llvm wrote:
> > tejohnson wrote:
> > > bd1976llvm wrote:
> > > > tejohnson wrote:
> > > > > Wouldn't this need to be *Policy.Interval, like in the below <= check?
> > > > The != operator is overloaded so it does the right thing.
> > > Ah ok, see that. It looks like <= has the same overloads - can the * be removed there?
> > Nope. On some platforms, e.g. windows, the type of TimeStampModTime is nanoseconds. Therefore, none of the Optional <= operator overloads will match.
> Oh I see. I suppose there are <= overloads to make the comparison between the Interval in std::chrono::seconds and a TimeStampModTime in nanoseconds work as desired?
Indeed. What will happen is that a nanoseconds type will be constructed from the Policy.Interval which is of type seconds (this is where there is potential for overflow) and then the comparison will be between the two seconds types.


https://reviews.llvm.org/D41497





More information about the llvm-commits mailing list