summaryrefslogtreecommitdiffstats
path: root/llvm/tools/llvm-lto/llvm-lto.cpp
diff options
context:
space:
mode:
authorJames Henderson <jh7370@my.bristol.ac.uk>2018-10-03 13:00:20 +0000
committerJames Henderson <jh7370@my.bristol.ac.uk>2018-10-03 13:00:20 +0000
commit99031b79a678fbd685defce0e61696ba04f45f25 (patch)
tree08351ebca1896c05e56dcc39026f975f63a9b395 /llvm/tools/llvm-lto/llvm-lto.cpp
parentfb3a97bec033e1b8243404678e0149c4c268ef41 (diff)
downloadbcm5719-llvm-99031b79a678fbd685defce0e61696ba04f45f25.tar.gz
bcm5719-llvm-99031b79a678fbd685defce0e61696ba04f45f25.zip
[ThinLTO]Expose cache entry expiration time option in llvm-lto and fix a test
Two cases in a ThinLTO test were passing for the wrong reasons, since rL340374. The tests were supposed to be testing that files were being pruned due to the cache size, but they were in fact being pruned because they were older than the default expiration period of 1 week. This change fixes the tests by explicitly setting the expiration time to the maximum value. This required the option to be exposed in llvm-lto. By assigning all files in the cache a similar time, it is possible to see that the newest files are still being kept, and that we aren't passing for the wrong reason again. In the event that the entry expiration were to expire for them, then the test would start failing, because these files would be removed too. Reviewed by: rnk, inglorion Differential Revision: https://reviews.llvm.org/D51992 llvm-svn: 343687
Diffstat (limited to 'llvm/tools/llvm-lto/llvm-lto.cpp')
-rw-r--r--llvm/tools/llvm-lto/llvm-lto.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/llvm/tools/llvm-lto/llvm-lto.cpp b/llvm/tools/llvm-lto/llvm-lto.cpp
index 25f086fdac9..dd19424157c 100644
--- a/llvm/tools/llvm-lto/llvm-lto.cpp
+++ b/llvm/tools/llvm-lto/llvm-lto.cpp
@@ -166,6 +166,10 @@ static cl::opt<int>
ThinLTOCacheMaxSizeFiles("thinlto-cache-max-size-files", cl::init(1000000),
cl::desc("Set ThinLTO cache pruning directory maximum number of files."));
+static cl::opt<unsigned>
+ ThinLTOCacheEntryExpiration("thinlto-cache-entry-expiration", cl::init(604800) /* 1w */,
+ cl::desc("Set ThinLTO cache entry expiration time."));
+
static cl::opt<std::string> ThinLTOSaveTempsPrefix(
"thinlto-save-temps",
cl::desc("Save ThinLTO temp files using filenames created by adding "
@@ -481,6 +485,7 @@ public:
ThinGenerator.setTargetOptions(Options);
ThinGenerator.setCacheDir(ThinLTOCacheDir);
ThinGenerator.setCachePruningInterval(ThinLTOCachePruningInterval);
+ ThinGenerator.setCacheEntryExpiration(ThinLTOCacheEntryExpiration);
ThinGenerator.setCacheMaxSizeFiles(ThinLTOCacheMaxSizeFiles);
ThinGenerator.setCacheMaxSizeBytes(ThinLTOCacheMaxSizeBytes);
ThinGenerator.setFreestanding(EnableFreestanding);
OpenPOWER on IntegriCloud