]> granicus.if.org Git - llvm/commitdiff
CachePruning: correct comment about file order. NFC
authorPawel Bylica <chfast@gmail.com>
Mon, 27 Jun 2016 08:46:23 +0000 (08:46 +0000)
committerPawel Bylica <chfast@gmail.com>
Mon, 27 Jun 2016 08:46:23 +0000 (08:46 +0000)
Summary: Actually the list of cached files is sorted by file size, not by last accessed time. Also remove unused file access time param for a helper function.

Reviewers: joker-eph, chandlerc, davide

Subscribers: llvm-commits

Differential Revision: http://reviews.llvm.org/D21639

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273852 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Support/CachePruning.cpp

index 944f41df227112218018508b9a822246c16da7a7..bd42befce3868d386592b2b9674c05a2ee0dfb98 100644 (file)
@@ -88,9 +88,9 @@ bool CachePruning::prune() {
   std::set<std::pair<uint64_t, std::string>> FileSizes;
   uint64_t TotalSize = 0;
   // Helper to add a path to the set of files to consider for size-based
-  // pruning, sorted by last accessed time.
+  // pruning, sorted by size.
   auto AddToFileListForSizePruning =
-      [&](StringRef Path, sys::TimeValue FileAccessTime) {
+      [&](StringRef Path) {
         if (!ShouldComputeSize)
           return;
         TotalSize += FileStatus.getSize();
@@ -128,7 +128,7 @@ bool CachePruning::prune() {
     }
 
     // Leave it here for now, but add it to the list of size-based pruning.
-    AddToFileListForSizePruning(File->path(), FileAccessTime);
+    AddToFileListForSizePruning(File->path());
   }
 
   // Prune for size now if needed