diff options
| author | Dimitry Andric <dim@FreeBSD.org> | 2017-12-24 01:04:58 +0000 | 
|---|---|---|
| committer | Dimitry Andric <dim@FreeBSD.org> | 2017-12-24 01:04:58 +0000 | 
| commit | da09e106efc76da569f2bad3d59b6b19b503bf39 (patch) | |
| tree | 3dc7690165275d86df8841532970801b0dc1230d /contrib/llvm/lib/Support/CachePruning.cpp | |
| parent | fb142d88715c407bebf777730d5bd6cbf73e2bc7 (diff) | |
| parent | c7dac04c3480f3c20487f912f77343139fce2d99 (diff) | |
Notes
Diffstat (limited to 'contrib/llvm/lib/Support/CachePruning.cpp')
| -rw-r--r-- | contrib/llvm/lib/Support/CachePruning.cpp | 4 | 
1 files changed, 3 insertions, 1 deletions
| diff --git a/contrib/llvm/lib/Support/CachePruning.cpp b/contrib/llvm/lib/Support/CachePruning.cpp index 3e97c991f504..141573c2a1c7 100644 --- a/contrib/llvm/lib/Support/CachePruning.cpp +++ b/contrib/llvm/lib/Support/CachePruning.cpp @@ -165,12 +165,14 @@ bool llvm::pruneCache(StringRef Path, CachePruningPolicy Policy) {        return false;      }    } else { +    if (!Policy.Interval) +      return false;      if (Policy.Interval != seconds(0)) {        // Check whether the time stamp is older than our pruning interval.        // If not, do nothing.        const auto TimeStampModTime = FileStatus.getLastModificationTime();        auto TimeStampAge = CurrentTime - TimeStampModTime; -      if (TimeStampAge <= Policy.Interval) { +      if (TimeStampAge <= *Policy.Interval) {          DEBUG(dbgs() << "Timestamp file too recent ("                       << duration_cast<seconds>(TimeStampAge).count()                       << "s old), do not prune.\n"); | 
