summaryrefslogtreecommitdiffstats
path: root/lld/ELF/LTO.cpp
diff options
context:
space:
mode:
authorPeter Collingbourne <peter@pcc.me.uk>2017-03-17 02:24:16 +0000
committerPeter Collingbourne <peter@pcc.me.uk>2017-03-17 02:24:16 +0000
commitee59e43f929e7d1512a12211046c77e76ffefe39 (patch)
tree5dc5b1eca0e40f061b630df74c4f668d3d51e21c /lld/ELF/LTO.cpp
parent8713bf69b68ef7c0c3b182c8741b760c8f7ffe4d (diff)
downloadbcm5719-llvm-ee59e43f929e7d1512a12211046c77e76ffefe39.tar.gz
bcm5719-llvm-ee59e43f929e7d1512a12211046c77e76ffefe39.zip
ELF: Add cache pruning support.
This patch causes us to use pruneCache() to prune the ThinLTO cache after completing LTO. A new flag --thinlto-cache-policy allows users to configure the policy. Differential Revision: https://reviews.llvm.org/D31021 llvm-svn: 298036
Diffstat (limited to 'lld/ELF/LTO.cpp')
-rw-r--r--lld/ELF/LTO.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/lld/ELF/LTO.cpp b/lld/ELF/LTO.cpp
index 83ae235b970..e294a5e6997 100644
--- a/lld/ELF/LTO.cpp
+++ b/lld/ELF/LTO.cpp
@@ -163,6 +163,9 @@ std::vector<InputFile *> BitcodeCompiler::compile() {
},
Cache));
+ if (!Config->ThinLTOCacheDir.empty())
+ pruneCache(Config->ThinLTOCacheDir, Config->ThinLTOCachePolicy);
+
for (unsigned I = 0; I != MaxTasks; ++I) {
if (Buff[I].empty())
continue;
OpenPOWER on IntegriCloud