LLVM  6.0.0svn
Functions
ThinLTO Cache Control

// endgoup LLVMCTLTOThese entry points control the ThinLTO cache. More...

Collaboration diagram for ThinLTO Cache Control:

Functions

void thinlto_codegen_set_cache_dir (thinlto_code_gen_t cg, const char *cache_dir)
 Sets the path to a directory to use as a cache storage for incremental build. More...
 
void thinlto_codegen_set_cache_pruning_interval (thinlto_code_gen_t cg, int interval)
 Sets the cache pruning interval (in seconds). More...
 
void thinlto_codegen_set_final_cache_size_relative_to_available_space (thinlto_code_gen_t cg, unsigned percentage)
 Sets the maximum cache size that can be persistent across build, in terms of percentage of the available space on the the disk. More...
 
void thinlto_codegen_set_cache_entry_expiration (thinlto_code_gen_t cg, unsigned expiration)
 Sets the expiration (in seconds) for an entry in the cache. More...
 

Detailed Description

// endgoup LLVMCTLTO

These entry points control the ThinLTO cache.

The cache is intended to support incremental build, and thus needs to be persistent accross build. The client enabled the cache by supplying a path to an existing directory. The code generator will use this to store objects files that may be reused during a subsequent build. To avoid filling the disk space, a few knobs are provided:

Function Documentation

◆ thinlto_codegen_set_cache_dir()

void thinlto_codegen_set_cache_dir ( thinlto_code_gen_t  cg,
const char cache_dir 
)

Sets the path to a directory to use as a cache storage for incremental build.

Setting this activates caching.

Since
LTO_API_VERSION=18

◆ thinlto_codegen_set_cache_entry_expiration()

void thinlto_codegen_set_cache_entry_expiration ( thinlto_code_gen_t  cg,
unsigned  expiration 
)

Sets the expiration (in seconds) for an entry in the cache.

An unspecified default value will be applied. A value of 0 will be ignored.

Since
LTO_API_VERSION=18

◆ thinlto_codegen_set_cache_pruning_interval()

void thinlto_codegen_set_cache_pruning_interval ( thinlto_code_gen_t  cg,
int  interval 
)

Sets the cache pruning interval (in seconds).

A negative value disable the pruning. An unspecified default value will be applied, and a value of 0 will be ignored.

Since
LTO_API_VERSION=18

◆ thinlto_codegen_set_final_cache_size_relative_to_available_space()

void thinlto_codegen_set_final_cache_size_relative_to_available_space ( thinlto_code_gen_t  cg,
unsigned  percentage 
)

Sets the maximum cache size that can be persistent across build, in terms of percentage of the available space on the the disk.

Set to 100 to indicate no limit, 50 to indicate that the cache size will not be left over half the available space. A value over 100 will be reduced to 100, a value of 0 will be ignored. An unspecified default value will be applied.

The formula looks like: AvailableSpace = FreeSpace + ExistingCacheSize NewCacheSize = AvailableSpace * P/100

Since
LTO_API_VERSION=18