|
LLVM 23.0.0git
|
// endgoup LLVMCLTO More...
Topics | |
| ThinLTO Cache Control | |
| // endgoup LLVMCTLTO | |
Classes | |
| struct | LTOObjectBuffer |
| Type to wrap a single object returned by ThinLTO. More... | |
Functions | |
| LLVM_C_ABI thinlto_code_gen_t | thinlto_create_codegen (void) |
| Instantiates a ThinLTO code generator. | |
| LLVM_C_ABI void | thinlto_codegen_dispose (thinlto_code_gen_t cg) |
| Frees the generator and all memory it internally allocated. | |
| LLVM_C_ABI void | thinlto_codegen_add_module (thinlto_code_gen_t cg, const char *identifier, const char *data, int length) |
| Add a module to a ThinLTO code generator. | |
| LLVM_C_ABI void | thinlto_codegen_process (thinlto_code_gen_t cg) |
| Optimize and codegen all the modules added to the codegenerator using ThinLTO. | |
| LLVM_C_ABI unsigned int | thinlto_module_get_num_objects (thinlto_code_gen_t cg) |
| Returns the number of object files produced by the ThinLTO CodeGenerator. | |
| LLVM_C_ABI LTOObjectBuffer | thinlto_module_get_object (thinlto_code_gen_t cg, unsigned int index) |
| Returns a reference to the ith object file produced by the ThinLTO CodeGenerator. | |
| LLVM_C_ABI unsigned int | thinlto_module_get_num_object_files (thinlto_code_gen_t cg) |
| Returns the number of object files produced by the ThinLTO CodeGenerator. | |
| LLVM_C_ABI const char * | thinlto_module_get_object_file (thinlto_code_gen_t cg, unsigned int index) |
| Returns the path to the ith object file produced by the ThinLTO CodeGenerator. | |
| LLVM_C_ABI lto_bool_t | thinlto_codegen_set_pic_model (thinlto_code_gen_t cg, lto_codegen_model) |
| Sets which PIC code model to generate. | |
| LLVM_C_ABI void | thinlto_codegen_set_savetemps_dir (thinlto_code_gen_t cg, const char *save_temps_dir) |
| Sets the path to a directory to use as a storage for temporary bitcode files. | |
| LLVM_C_ABI void | thinlto_set_generated_objects_dir (thinlto_code_gen_t cg, const char *save_temps_dir) |
| Set the path to a directory where to save generated object files. | |
| LLVM_C_ABI void | thinlto_codegen_set_cpu (thinlto_code_gen_t cg, const char *cpu) |
| Sets the cpu to generate code for. | |
| LLVM_C_ABI void | thinlto_codegen_disable_codegen (thinlto_code_gen_t cg, lto_bool_t disable) |
| Disable CodeGen, only run the stages till codegen and stop. | |
| LLVM_C_ABI void | thinlto_codegen_set_codegen_only (thinlto_code_gen_t cg, lto_bool_t codegen_only) |
| Perform CodeGen only: disable all other stages. | |
| LLVM_C_ABI void | thinlto_debug_options (const char *const *options, int number) |
| Parse -mllvm style debug options. | |
| LLVM_C_ABI lto_bool_t | lto_module_is_thinlto (lto_module_t mod) |
| Test if a module has support for ThinLTO linking. | |
| LLVM_C_ABI void | thinlto_codegen_add_must_preserve_symbol (thinlto_code_gen_t cg, const char *name, int length) |
| Adds a symbol to the list of global symbols that must exist in the final generated code. | |
| LLVM_C_ABI void | thinlto_codegen_add_cross_referenced_symbol (thinlto_code_gen_t cg, const char *name, int length) |
| Adds a symbol to the list of global symbols that are cross-referenced between ThinLTO files. | |
// endgoup LLVMCLTO
|
extern |
|
extern |
Adds a symbol to the list of global symbols that are cross-referenced between ThinLTO files.
If the ThinLTO CodeGenerator can ensure that every references from a ThinLTO module to this symbol is optimized away, then the symbol can be discarded.
References name.
|
extern |
Add a module to a ThinLTO code generator.
Identifier has to be unique among all the modules in a code generator. The data buffer stays owned by the client, and is expected to be available for the entire lifetime of the thinlto_code_gen_t it is added to.
On failure, returns NULL (check lto_get_error_message() for details).
References data, and LLVM_C_ABI.
|
extern |
Adds a symbol to the list of global symbols that must exist in the final generated code.
If a function is not listed there, it might be inlined into every usage and optimized away. For every single module, the functions referenced from code outside of the ThinLTO modules need to be added here.
References LLVM_C_ABI, and name.
|
extern |
Disable CodeGen, only run the stages till codegen and stop.
The output will be bitcode.
References LLVM_C_ABI.
|
extern |
Frees the generator and all memory it internally allocated.
Upon return the thinlto_code_gen_t is no longer valid.
References LLVM_C_ABI.
|
extern |
Optimize and codegen all the modules added to the codegenerator using ThinLTO.
Resulting objects are accessible using thinlto_module_get_object().
References LLVM_C_ABI.
|
extern |
Perform CodeGen only: disable all other stages.
|
extern |
|
extern |
Sets which PIC code model to generate.
Returns true on error (check lto_get_error_message() for details).
References LLVM_C_ABI.
|
extern |
Sets the path to a directory to use as a storage for temporary bitcode files.
The intention is to make the bitcode files available for debugging at various stage of the pipeline.
|
extern |
Instantiates a ThinLTO code generator.
Returns NULL on error (check lto_get_error_message() for details).
The ThinLTOCodeGenerator is not intended to be reuse for multiple compilation: the model is that the client adds modules to the generator and ask to perform the ThinLTO optimizations / codegen, and finally destroys the codegenerator.
References LLVM_C_ABI.
|
extern |
| LLVM_C_ABI unsigned int thinlto_module_get_num_object_files | ( | thinlto_code_gen_t | cg | ) |
Returns the number of object files produced by the ThinLTO CodeGenerator.
It usually matches the number of input files, but this is not a guarantee of the API and may change in future implementation, so the client should not assume it.
|
extern |
Returns the number of object files produced by the ThinLTO CodeGenerator.
It usually matches the number of input files, but this is not a guarantee of the API and may change in future implementation, so the client should not assume it.
References LLVM_C_ABI.
|
extern |
Returns a reference to the ith object file produced by the ThinLTO CodeGenerator.
Client should use thinlto_module_get_num_objects() to get the number of available objects.
References LLVM_C_ABI.
| LLVM_C_ABI const char * thinlto_module_get_object_file | ( | thinlto_code_gen_t | cg, |
| unsigned int | index ) |
Returns the path to the ith object file produced by the ThinLTO CodeGenerator.
Client should use thinlto_module_get_num_object_files() to get the number of available objects.
References LLVM_C_ABI.
| LLVM_C_ABI void thinlto_set_generated_objects_dir | ( | thinlto_code_gen_t | cg, |
| const char * | save_temps_dir ) |
Set the path to a directory where to save generated object files.
This path can be used by a linker to request on-disk files instead of in-memory buffers. When set, results are available through thinlto_module_get_object_file() instead of thinlto_module_get_object().
References LLVM_C_ABI.