diff options
Diffstat (limited to 'llvm/include')
-rw-r--r-- | llvm/include/llvm-c/lto.h | 24 | ||||
-rw-r--r-- | llvm/include/llvm/LTO/legacy/ThinLTOCodeGenerator.h | 15 |
2 files changed, 38 insertions, 1 deletions
diff --git a/llvm/include/llvm-c/lto.h b/llvm/include/llvm-c/lto.h index 4eee5f1f113..65d172dea18 100644 --- a/llvm/include/llvm-c/lto.h +++ b/llvm/include/llvm-c/lto.h @@ -44,7 +44,7 @@ typedef bool lto_bool_t; * @{ */ -#define LTO_API_VERSION 21 +#define LTO_API_VERSION 22 /** * \since prior to LTO_API_VERSION=3 @@ -817,6 +817,28 @@ extern void thinlto_codegen_set_cache_entry_expiration(thinlto_code_gen_t cg, unsigned expiration); /** + * Sets the maximum size of the cache directory (in bytes). A value over the + * amount of available space on the disk will be reduced to the amount of + * available space. An unspecified default value will be applied. A value of 0 + * will be ignored. + * + * \since LTO_API_VERSION=22 + */ +extern void thinlto_codegen_set_cache_size_bytes(thinlto_code_gen_t cg, + unsigned max_size_bytes); + +/** + * Sets the maximum number of files in the cache directory. An unspecified + * default value will be applied. A value of 0 will be ignored. + * + * \since LTO_API_VERSION=22 + */ +extern void thinlto_codegen_set_cache_size_files(thinlto_code_gen_t cg, + unsigned max_size_files); + + + +/** * @} // endgroup LLVMCTLTO_CACHING */ diff --git a/llvm/include/llvm/LTO/legacy/ThinLTOCodeGenerator.h b/llvm/include/llvm/LTO/legacy/ThinLTOCodeGenerator.h index e47456445f0..b32a972542c 100644 --- a/llvm/include/llvm/LTO/legacy/ThinLTOCodeGenerator.h +++ b/llvm/include/llvm/LTO/legacy/ThinLTOCodeGenerator.h @@ -184,6 +184,21 @@ public: CacheOptions.Policy.MaxSizePercentageOfAvailableSpace = Percentage; } + /// Cache policy: the maximum size for the cache directory in bytes. A value + /// over the amount of available space on the disk will be reduced to the + /// amount of available space. A value of 0 will be ignored. + void setCacheMaxSizeBytes(unsigned MaxSizeBytes) { + if (MaxSizeBytes) + CacheOptions.Policy.MaxSizeBytes = MaxSizeBytes; + } + + /// Cache policy: the maximum number of files in the cache directory. A value + /// of 0 will be ignored. + void setCacheMaxSizeFiles(unsigned MaxSizeFiles) { + if (MaxSizeFiles) + CacheOptions.Policy.MaxSizeFiles = MaxSizeFiles; + } + /**@}*/ /// Set the path to a directory where to save temporaries at various stages of |