summaryrefslogtreecommitdiffstats
path: root/llvm/tools/llvm-lto/llvm-lto.cpp
diff options
context:
space:
mode:
authorEkaterina Romanova <katya_romanova@playstation.sony.com>2018-03-02 03:51:27 +0000
committerEkaterina Romanova <katya_romanova@playstation.sony.com>2018-03-02 03:51:27 +0000
commitb8aeec46b7fb0a88c74208a577dc0b441ed03cfe (patch)
treed7cd269c038895a557cb5fdc49619fe0bd8e6ec8 /llvm/tools/llvm-lto/llvm-lto.cpp
parentdfcd846b2632a8d67653e39197c4cb3d0ef70016 (diff)
downloadbcm5719-llvm-b8aeec46b7fb0a88c74208a577dc0b441ed03cfe.tar.gz
bcm5719-llvm-b8aeec46b7fb0a88c74208a577dc0b441ed03cfe.zip
[ThinLTO] Added a couple of C LTO API interfaces to control the cache policy.
- thinlto_codegen_set_cache_size_bytes to control the absolute size of cache directory. - thinlto_codegen_set_cache_size_files the size and amount of files in cache directory. These functions have been supported in C++ LTO API for a long time, but were absent in C LTO API. Differential Revision: https://reviews.llvm.org/D42446 llvm-svn: 326537
Diffstat (limited to 'llvm/tools/llvm-lto/llvm-lto.cpp')
-rw-r--r--llvm/tools/llvm-lto/llvm-lto.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/llvm/tools/llvm-lto/llvm-lto.cpp b/llvm/tools/llvm-lto/llvm-lto.cpp
index 9e5458f4ad9..87c998c9032 100644
--- a/llvm/tools/llvm-lto/llvm-lto.cpp
+++ b/llvm/tools/llvm-lto/llvm-lto.cpp
@@ -160,6 +160,14 @@ static cl::opt<int>
ThinLTOCachePruningInterval("thinlto-cache-pruning-interval",
cl::init(1200), cl::desc("Set ThinLTO cache pruning interval."));
+static cl::opt<int>
+ ThinLTOCacheMaxSizeBytes("thinlto-cache-max-size-bytes",
+ cl::desc("Set ThinLTO cache pruning directory maximum size in bytes."));
+
+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<std::string> ThinLTOSaveTempsPrefix(
"thinlto-save-temps",
cl::desc("Save ThinLTO temp files using filenames created by adding "
@@ -475,6 +483,8 @@ public:
ThinGenerator.setTargetOptions(Options);
ThinGenerator.setCacheDir(ThinLTOCacheDir);
ThinGenerator.setCachePruningInterval(ThinLTOCachePruningInterval);
+ ThinGenerator.setCacheMaxSizeFiles(ThinLTOCacheMaxSizeFiles);
+ ThinGenerator.setCacheMaxSizeBytes(ThinLTOCacheMaxSizeBytes);
ThinGenerator.setFreestanding(EnableFreestanding);
// Add all the exported symbols to the table of symbols to preserve.
OpenPOWER on IntegriCloud