[llvm] r273852 - CachePruning: correct comment about file order. NFC
Pawel Bylica via llvm-commits
llvm-commits at lists.llvm.org
Mon Jun 27 01:46:23 PDT 2016
Author: chfast
Date: Mon Jun 27 03:46:23 2016
New Revision: 273852
URL: http://llvm.org/viewvc/llvm-project?rev=273852&view=rev
Log:
CachePruning: correct comment about file order. NFC
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
Modified:
llvm/trunk/lib/Support/CachePruning.cpp
Modified: llvm/trunk/lib/Support/CachePruning.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Support/CachePruning.cpp?rev=273852&r1=273851&r2=273852&view=diff
==============================================================================
--- llvm/trunk/lib/Support/CachePruning.cpp (original)
+++ llvm/trunk/lib/Support/CachePruning.cpp Mon Jun 27 03:46:23 2016
@@ -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
More information about the llvm-commits
mailing list