Class LLVMLTO
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classContains the function pointers loaded from the LTOSharedLibrary. -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intstatic final intlto_codegen_modelstatic final intlto_codegen_modelstatic final intlto_codegen_modelstatic final intlto_codegen_modelstatic final intlto_debug_modelstatic final intlto_debug_modelstatic final intDiagnostic severity.static final intDiagnostic severity.static final intDiagnostic severity.static final intDiagnostic severity.static final intlto_symbol_attributesstatic final intlto_symbol_attributesstatic final intlto_symbol_attributesstatic final intlto_symbol_attributesstatic final intlto_symbol_attributesstatic final intlto_symbol_attributesstatic final intlto_symbol_attributesstatic final intlto_symbol_attributesstatic final intlto_symbol_attributesstatic final intlto_symbol_attributesstatic final intlto_symbol_attributesstatic final intlto_symbol_attributesstatic final intlto_symbol_attributesstatic final intlto_symbol_attributesstatic final intlto_symbol_attributesstatic final intlto_symbol_attributesstatic final intlto_symbol_attributesstatic final intlto_symbol_attributesstatic final intlto_symbol_attributes -
Method Summary
Modifier and TypeMethodDescriptionstatic org.lwjgl.system.SharedLibraryReturns the LTOSharedLibrary.static intReturns the runtime API version.static booleanlto_codegen_add_module(long cg, long mod) Add an object module to the set of modules for which code will be generated.static voidlto_codegen_add_must_preserve_symbol(long cg, CharSequence symbol) Adds to a list of all global symbols that must exist in the final generated code.static voidlto_codegen_add_must_preserve_symbol(long cg, ByteBuffer symbol) Adds to a list of all global symbols that must exist in the final generated code.static @Nullable ByteBufferlto_codegen_compile(long cg) Generates code for all added modules into one native object file.static @Nullable ByteBufferlto_codegen_compile_optimized(long cg) Generates code for the optimized merged module into one native object file.static booleanlto_codegen_compile_to_file(long cg, org.lwjgl.PointerBuffer name) Generates code for all added modules into one native object file.static longInstantiates a code generator.static longInstantiate a code generator in its own context.static voidlto_codegen_debug_options(long cg, CharSequence options) Sets options to help debug codegen bugs.static voidlto_codegen_debug_options(long cg, ByteBuffer options) Sets options to help debug codegen bugs.static voidlto_codegen_debug_options_array(long cg, org.lwjgl.PointerBuffer options) Same ascodegen_debug_options, but takes every option separately through an array.static voidlto_codegen_dispose(long cg) Frees all code generator and all memory it internally allocated.static booleanlto_codegen_optimize(long cg) Runs optimization for the merged module.static voidlto_codegen_set_assembler_args(long cg, org.lwjgl.PointerBuffer args) Sets extra arguments that libLTO should pass to the assembler.static voidlto_codegen_set_assembler_path(long cg, CharSequence path) Sets the location of the assembler tool to run.static voidlto_codegen_set_assembler_path(long cg, ByteBuffer path) Sets the location of the assembler tool to run.static voidlto_codegen_set_cpu(long cg, CharSequence cpu) Sets the cpu to generate code for.static voidlto_codegen_set_cpu(long cg, ByteBuffer cpu) Sets the cpu to generate code for.static booleanlto_codegen_set_debug_model(long cg, int model) Sets if debug info should be generated.static voidlto_codegen_set_diagnostic_handler(long cg, LTODiagnosticHandlerI handler, long ctxt) Set a diagnostic handler and the related context (void *).static voidlto_codegen_set_module(long cg, long mod) Sets the object module for code generation.static booleanlto_codegen_set_pic_model(long cg, int model) Sets which PIC code model to generated.static voidlto_codegen_set_should_embed_uselists(long cg, boolean ShouldEmbedUselists) Set whether to embed uselists in bitcode.static voidlto_codegen_set_should_internalize(long cg, boolean ShouldInternalize) Sets if we should run internalize pass during optimization and code generation.static booleanlto_codegen_write_merged_modules(long cg, CharSequence path) Writes a new object file at the specified path that contains the merged contents of all modules added so far.static booleanlto_codegen_write_merged_modules(long cg, ByteBuffer path) Writes a new object file at the specified path that contains the merged contents of all modules added so far.static @Nullable StringReturns the last error string orNULLif last operation was successful.static StringReturns a printable string.static voidInitializes LLVM disassemblers.static longlto_input_create(ByteBuffer buffer, CharSequence path) Creates an LTO input file from a buffer.static longlto_input_create(ByteBuffer buffer, ByteBuffer path) Creates an LTO input file from a buffer.static voidlto_input_dispose(long input) Frees all memory internally allocated by the LTO input file.static @Nullable Stringlto_input_get_dependent_library(long input, long index) Returns theithdependent library specifier for the given LTO input file.static intlto_input_get_num_dependent_libraries(long input) Returns the number of dependent library specifiers for the given LTO input file.static longLoads an object file from disk.static longlto_module_create(ByteBuffer path) Loads an object file from disk.static longlto_module_create_from_fd(int fd, CharSequence path, long file_size) Loads an object file from disk.static longlto_module_create_from_fd(int fd, ByteBuffer path, long file_size) Loads an object file from disk.static longlto_module_create_from_fd_at_offset(int fd, CharSequence path, long file_size, long map_size, long offset) Loads an object file from disk.static longlto_module_create_from_fd_at_offset(int fd, ByteBuffer path, long file_size, long map_size, long offset) Loads an object file from disk.static longLoads an object file from memory.static longLoads an object file from memory with an extra path argument.static longLoads an object file from memory with an extra path argument.static longlto_module_create_in_codegen_context(ByteBuffer mem, CharSequence path, long cg) Loads an object file in the codegen context.static longlto_module_create_in_codegen_context(ByteBuffer mem, ByteBuffer path, long cg) Loads an object file in the codegen context.static longLoads an object file in its own context.static longLoads an object file in its own context.static voidlto_module_dispose(long mod) Frees all memory internally allocated by the module.static @Nullable Stringlto_module_get_linkeropts(long mod) Returns the module's linker options.static booleanlto_module_get_macho_cputype(long mod, IntBuffer out_cputype, IntBuffer out_cpusubtype) If targeting mach-o on darwin, this function gets the CPU type and subtype that will end up being encoded in the mach-o header.static intlto_module_get_num_symbols(long mod) Returns the number of symbols in the object module.static intlto_module_get_symbol_attribute(long mod, int index) Returns the attributes of the ith symbol in the object module.static @Nullable Stringlto_module_get_symbol_name(long mod, int index) Returns the name of the ith symbol in the object module.static @Nullable Stringlto_module_get_target_triple(long mod) Returns triple string which the object module was compiled under.static booleanlto_module_has_ctor_dtor(long mod) This function can be used by the linker to check if a given module has any constructor or destructor functions.static booleanReturn true ifBuffercontains a bitcode file with ObjC code (category or class) in it.static booleanChecks if a file is a loadable object file.static booleanChecks if a file is a loadable object file.static booleanlto_module_is_object_file_for_target(CharSequence path, CharSequence target_triple_prefix) Checks if a file is a loadable object compiled for requested target.static booleanlto_module_is_object_file_for_target(ByteBuffer path, ByteBuffer target_triple_prefix) Checks if a file is a loadable object compiled for requested target.static booleanChecks if a buffer is a loadable object file.static booleanlto_module_is_object_file_in_memory_for_target(ByteBuffer mem, CharSequence target_triple_prefix) Checks if a buffer is a loadable object compiled for requested target.static booleanlto_module_is_object_file_in_memory_for_target(ByteBuffer mem, ByteBuffer target_triple_prefix) Checks if a buffer is a loadable object compiled for requested target.static booleanlto_module_is_thinlto(long mod) Test if a module has support for ThinLTO linking.static voidlto_module_set_target_triple(long mod, CharSequence triple) Sets triple string with which the object will be codegened.static voidlto_module_set_target_triple(long mod, ByteBuffer triple) Sets triple string with which the object will be codegened.static @Nullable org.lwjgl.PointerBufferReturns the list oflibcallsymbols that can be generated by LTO that might not be visible from the symbol table of bitcode files.static voidlto_set_debug_options(org.lwjgl.PointerBuffer options) Parses options immediately, making them available as early as possible.static voidnlto_codegen_add_must_preserve_symbol(long cg, long symbol) Unsafe version of:codegen_add_must_preserve_symbolstatic longnlto_codegen_compile(long cg, long length) Unsafe version of:codegen_compilestatic longnlto_codegen_compile_optimized(long cg, long length) Unsafe version of:codegen_compile_optimizedstatic booleannlto_codegen_compile_to_file(long cg, long name) Unsafe version of:codegen_compile_to_filestatic voidnlto_codegen_debug_options(long cg, long options) Unsafe version of:codegen_debug_optionsstatic voidnlto_codegen_debug_options_array(long cg, long options, int number) Unsafe version of:codegen_debug_options_arraystatic voidnlto_codegen_set_assembler_args(long cg, long args, int nargs) Unsafe version of:codegen_set_assembler_argsstatic voidnlto_codegen_set_assembler_path(long cg, long path) Unsafe version of:codegen_set_assembler_pathstatic voidnlto_codegen_set_cpu(long cg, long cpu) Unsafe version of:codegen_set_cpustatic voidnlto_codegen_set_diagnostic_handler(long cg, long handler, long ctxt) Unsafe version of:codegen_set_diagnostic_handlerstatic booleannlto_codegen_write_merged_modules(long cg, long path) Unsafe version of:codegen_write_merged_modulesstatic longUnsafe version of:get_error_messagestatic longUnsafe version of:get_versionstatic longnlto_input_create(long buffer, long buffer_size, long path) Unsafe version of:input_createstatic longnlto_input_get_dependent_library(long input, long index, long size) Unsafe version of:input_get_dependent_librarystatic longnlto_module_create(long path) Unsafe version of:module_createstatic longnlto_module_create_from_fd(int fd, long path, long file_size) Unsafe version of:module_create_from_fdstatic longnlto_module_create_from_fd_at_offset(int fd, long path, long file_size, long map_size, long offset) Unsafe version of:module_create_from_fd_at_offsetstatic longnlto_module_create_from_memory(long mem, long length) Unsafe version of:module_create_from_memorystatic longnlto_module_create_from_memory_with_path(long mem, long length, long path) Unsafe version of:module_create_from_memory_with_pathstatic longnlto_module_create_in_codegen_context(long mem, long length, long path, long cg) Unsafe version of:module_create_in_codegen_contextstatic longnlto_module_create_in_local_context(long mem, long length, long path) Unsafe version of:module_create_in_local_contextstatic longnlto_module_get_linkeropts(long mod) Unsafe version of:module_get_linkeroptsstatic booleannlto_module_get_macho_cputype(long mod, long out_cputype, long out_cpusubtype) Unsafe version of:module_get_macho_cputypestatic longnlto_module_get_symbol_name(long mod, int index) Unsafe version of:module_get_symbol_namestatic longnlto_module_get_target_triple(long mod) Unsafe version of:module_get_target_triplestatic booleannlto_module_has_objc_category(long mem, long length) Unsafe version of:module_has_objc_categorystatic booleannlto_module_is_object_file(long path) Unsafe version of:module_is_object_filestatic booleannlto_module_is_object_file_for_target(long path, long target_triple_prefix) Unsafe version of:module_is_object_file_for_targetstatic booleannlto_module_is_object_file_in_memory(long mem, long length) Unsafe version of:module_is_object_file_in_memorystatic booleannlto_module_is_object_file_in_memory_for_target(long mem, long length, long target_triple_prefix) Unsafe version of:module_is_object_file_in_memory_for_targetstatic voidnlto_module_set_target_triple(long mod, long triple) Unsafe version of:module_set_target_triplestatic longnlto_runtime_lib_symbols_list(long size) Unsafe version of:runtime_lib_symbols_liststatic voidnlto_set_debug_options(long options, int number) Unsafe version of:set_debug_optionsstatic voidnthinlto_codegen_add_cross_referenced_symbol(long cg, long name, int length) Unsafe version of:thinlto_codegen_add_cross_referenced_symbol(long, java.nio.ByteBuffer)static voidnthinlto_codegen_add_module(long cg, long identifier, long data, int length) Unsafe version of:thinlto_codegen_add_module(long, java.nio.ByteBuffer, java.nio.ByteBuffer)static voidnthinlto_codegen_add_must_preserve_symbol(long cg, long name, int length) Unsafe version of:thinlto_codegen_add_must_preserve_symbol(long, java.nio.ByteBuffer)static voidnthinlto_codegen_set_cache_dir(long cg, long cache_dir) Unsafe version of:thinlto_codegen_set_cache_dir(long, java.nio.ByteBuffer)static voidnthinlto_codegen_set_cpu(long cg, long cpu) Unsafe version of:thinlto_codegen_set_cpu(long, java.nio.ByteBuffer)static voidnthinlto_codegen_set_savetemps_dir(long cg, long save_temps_dir) Unsafe version of:thinlto_codegen_set_savetemps_dir(long, java.nio.ByteBuffer)static voidnthinlto_debug_options(long options, int number) Unsafe version of:thinlto_debug_options(org.lwjgl.PointerBuffer)static voidnthinlto_module_get_object(long cg, int index, long __result) Unsafe version of:thinlto_module_get_object(long, int, org.lwjgl.llvm.LTOObjectBuffer)static voidnthinlto_module_get_object(long cg, int index, long __functionAddress, long __result) Unsafe version of:thinlto_module_get_object(long, int, org.lwjgl.llvm.LTOObjectBuffer)static longnthinlto_module_get_object_file(long cg, int index) Unsafe version of:thinlto_module_get_object_file(long, int)static voidnthinlto_set_generated_objects_dir(long cg, long save_temps_dir) Unsafe version of:thinlto_set_generated_objects_dir(long, java.nio.ByteBuffer)static voidthinlto_codegen_add_cross_referenced_symbol(long cg, CharSequence name) Adds a symbol to the list of global symbols that are cross-referenced between ThinLTO files.static voidthinlto_codegen_add_cross_referenced_symbol(long cg, ByteBuffer name) Adds a symbol to the list of global symbols that are cross-referenced between ThinLTO files.static voidthinlto_codegen_add_module(long cg, CharSequence identifier, ByteBuffer data) Add a module to a ThinLTO code generator.static voidthinlto_codegen_add_module(long cg, ByteBuffer identifier, ByteBuffer data) Add a module to a ThinLTO code generator.static voidthinlto_codegen_add_must_preserve_symbol(long cg, CharSequence name) Adds a symbol to the list of global symbols that must exist in the final generated code.static voidthinlto_codegen_add_must_preserve_symbol(long cg, ByteBuffer name) Adds a symbol to the list of global symbols that must exist in the final generated code.static voidthinlto_codegen_disable_codegen(long cg, boolean disable) Disable CodeGen, only run the stages till codegen and stop.static voidthinlto_codegen_dispose(long cg) Frees the generator and all memory it internally allocated.static voidthinlto_codegen_process(long cg) Optimize and codegen all the modules added to the codegenerator using ThinLTO.static voidthinlto_codegen_set_cache_dir(long cg, CharSequence cache_dir) Sets the path to a directory to use as a cache storage for incremental build.static voidthinlto_codegen_set_cache_dir(long cg, ByteBuffer cache_dir) Sets the path to a directory to use as a cache storage for incremental build.static voidthinlto_codegen_set_cache_entry_expiration(long cg, int expiration) Sets the expiration (in seconds) for an entry in the cache.static voidthinlto_codegen_set_cache_pruning_interval(long cg, int interval) Sets the cache pruning interval (in seconds).static voidthinlto_codegen_set_cache_size_bytes(long cg, int max_size_bytes) Sets the maximum size of the cache directory (in bytes).static voidthinlto_codegen_set_cache_size_files(long cg, int max_size_files) Sets the maximum number of files in the cache directory.static voidthinlto_codegen_set_cache_size_megabytes(long cg, int max_size_megabytes) Same asthinlto_codegen_set_cache_size_bytes(long, int), except the maximum size is in megabytes (220 bytes).static voidthinlto_codegen_set_codegen_only(long cg, boolean codegen_only) Perform CodeGen only: disable all other stages.static voidthinlto_codegen_set_cpu(long cg, CharSequence cpu) Sets the cpu to generate code for.static voidthinlto_codegen_set_cpu(long cg, ByteBuffer cpu) Sets the cpu to generate code for.static voidthinlto_codegen_set_final_cache_size_relative_to_available_space(long cg, int percentage) Sets the maximum cache size that can be persistent across build, in terms of percentage of the available space on the disk.static booleanthinlto_codegen_set_pic_model(long cg, int model) Sets which PIC code model to generate.static voidthinlto_codegen_set_savetemps_dir(long cg, CharSequence save_temps_dir) Sets the path to a directory to use as a storage for temporary bitcode files.static voidthinlto_codegen_set_savetemps_dir(long cg, ByteBuffer save_temps_dir) Sets the path to a directory to use as a storage for temporary bitcode files.static longInstantiates a ThinLTO code generator.static voidthinlto_debug_options(org.lwjgl.PointerBuffer options) Parse-mllvmstyle debug options.static intthinlto_module_get_num_object_files(long cg) Returns the number of object files produced by the ThinLTO CodeGenerator.static intthinlto_module_get_num_objects(long cg) Returns the number of object files produced by the ThinLTO CodeGenerator.static LTOObjectBufferthinlto_module_get_object(long cg, int index, LTOObjectBuffer __result) Returns a reference to the ith object file produced by the ThinLTO CodeGenerator.static @Nullable Stringthinlto_module_get_object_file(long cg, int index) Returns the path to the ith object file produced by the ThinLTO CodeGenerator.static voidthinlto_set_generated_objects_dir(long cg, CharSequence save_temps_dir) Set the path to a directory where to save generated object files.static voidthinlto_set_generated_objects_dir(long cg, ByteBuffer save_temps_dir) Set the path to a directory where to save generated object files.
-
Field Details
-
LTOAPI_VERSION
public static final int LTOAPI_VERSION- See Also:
-
LTOSYMBOL_ALIGNMENT_MASK
public static final int LTOSYMBOL_ALIGNMENT_MASKlto_symbol_attributesEnum values:
SYMBOL_ALIGNMENT_MASK- log2 of alignmentSYMBOL_PERMISSIONS_MASKSYMBOL_PERMISSIONS_CODESYMBOL_PERMISSIONS_DATASYMBOL_PERMISSIONS_RODATASYMBOL_DEFINITION_MASKSYMBOL_DEFINITION_REGULARSYMBOL_DEFINITION_TENTATIVESYMBOL_DEFINITION_WEAKSYMBOL_DEFINITION_UNDEFINEDSYMBOL_DEFINITION_WEAKUNDEFSYMBOL_SCOPE_MASKSYMBOL_SCOPE_INTERNALSYMBOL_SCOPE_HIDDENSYMBOL_SCOPE_PROTECTEDSYMBOL_SCOPE_DEFAULTSYMBOL_SCOPE_DEFAULT_CAN_BE_HIDDENSYMBOL_COMDATSYMBOL_ALIAS
- See Also:
-
LTOSYMBOL_PERMISSIONS_MASK
public static final int LTOSYMBOL_PERMISSIONS_MASKlto_symbol_attributesEnum values:
SYMBOL_ALIGNMENT_MASK- log2 of alignmentSYMBOL_PERMISSIONS_MASKSYMBOL_PERMISSIONS_CODESYMBOL_PERMISSIONS_DATASYMBOL_PERMISSIONS_RODATASYMBOL_DEFINITION_MASKSYMBOL_DEFINITION_REGULARSYMBOL_DEFINITION_TENTATIVESYMBOL_DEFINITION_WEAKSYMBOL_DEFINITION_UNDEFINEDSYMBOL_DEFINITION_WEAKUNDEFSYMBOL_SCOPE_MASKSYMBOL_SCOPE_INTERNALSYMBOL_SCOPE_HIDDENSYMBOL_SCOPE_PROTECTEDSYMBOL_SCOPE_DEFAULTSYMBOL_SCOPE_DEFAULT_CAN_BE_HIDDENSYMBOL_COMDATSYMBOL_ALIAS
- See Also:
-
LTOSYMBOL_PERMISSIONS_CODE
public static final int LTOSYMBOL_PERMISSIONS_CODElto_symbol_attributesEnum values:
SYMBOL_ALIGNMENT_MASK- log2 of alignmentSYMBOL_PERMISSIONS_MASKSYMBOL_PERMISSIONS_CODESYMBOL_PERMISSIONS_DATASYMBOL_PERMISSIONS_RODATASYMBOL_DEFINITION_MASKSYMBOL_DEFINITION_REGULARSYMBOL_DEFINITION_TENTATIVESYMBOL_DEFINITION_WEAKSYMBOL_DEFINITION_UNDEFINEDSYMBOL_DEFINITION_WEAKUNDEFSYMBOL_SCOPE_MASKSYMBOL_SCOPE_INTERNALSYMBOL_SCOPE_HIDDENSYMBOL_SCOPE_PROTECTEDSYMBOL_SCOPE_DEFAULTSYMBOL_SCOPE_DEFAULT_CAN_BE_HIDDENSYMBOL_COMDATSYMBOL_ALIAS
- See Also:
-
LTOSYMBOL_PERMISSIONS_DATA
public static final int LTOSYMBOL_PERMISSIONS_DATAlto_symbol_attributesEnum values:
SYMBOL_ALIGNMENT_MASK- log2 of alignmentSYMBOL_PERMISSIONS_MASKSYMBOL_PERMISSIONS_CODESYMBOL_PERMISSIONS_DATASYMBOL_PERMISSIONS_RODATASYMBOL_DEFINITION_MASKSYMBOL_DEFINITION_REGULARSYMBOL_DEFINITION_TENTATIVESYMBOL_DEFINITION_WEAKSYMBOL_DEFINITION_UNDEFINEDSYMBOL_DEFINITION_WEAKUNDEFSYMBOL_SCOPE_MASKSYMBOL_SCOPE_INTERNALSYMBOL_SCOPE_HIDDENSYMBOL_SCOPE_PROTECTEDSYMBOL_SCOPE_DEFAULTSYMBOL_SCOPE_DEFAULT_CAN_BE_HIDDENSYMBOL_COMDATSYMBOL_ALIAS
- See Also:
-
LTOSYMBOL_PERMISSIONS_RODATA
public static final int LTOSYMBOL_PERMISSIONS_RODATAlto_symbol_attributesEnum values:
SYMBOL_ALIGNMENT_MASK- log2 of alignmentSYMBOL_PERMISSIONS_MASKSYMBOL_PERMISSIONS_CODESYMBOL_PERMISSIONS_DATASYMBOL_PERMISSIONS_RODATASYMBOL_DEFINITION_MASKSYMBOL_DEFINITION_REGULARSYMBOL_DEFINITION_TENTATIVESYMBOL_DEFINITION_WEAKSYMBOL_DEFINITION_UNDEFINEDSYMBOL_DEFINITION_WEAKUNDEFSYMBOL_SCOPE_MASKSYMBOL_SCOPE_INTERNALSYMBOL_SCOPE_HIDDENSYMBOL_SCOPE_PROTECTEDSYMBOL_SCOPE_DEFAULTSYMBOL_SCOPE_DEFAULT_CAN_BE_HIDDENSYMBOL_COMDATSYMBOL_ALIAS
- See Also:
-
LTOSYMBOL_DEFINITION_MASK
public static final int LTOSYMBOL_DEFINITION_MASKlto_symbol_attributesEnum values:
SYMBOL_ALIGNMENT_MASK- log2 of alignmentSYMBOL_PERMISSIONS_MASKSYMBOL_PERMISSIONS_CODESYMBOL_PERMISSIONS_DATASYMBOL_PERMISSIONS_RODATASYMBOL_DEFINITION_MASKSYMBOL_DEFINITION_REGULARSYMBOL_DEFINITION_TENTATIVESYMBOL_DEFINITION_WEAKSYMBOL_DEFINITION_UNDEFINEDSYMBOL_DEFINITION_WEAKUNDEFSYMBOL_SCOPE_MASKSYMBOL_SCOPE_INTERNALSYMBOL_SCOPE_HIDDENSYMBOL_SCOPE_PROTECTEDSYMBOL_SCOPE_DEFAULTSYMBOL_SCOPE_DEFAULT_CAN_BE_HIDDENSYMBOL_COMDATSYMBOL_ALIAS
- See Also:
-
LTOSYMBOL_DEFINITION_REGULAR
public static final int LTOSYMBOL_DEFINITION_REGULARlto_symbol_attributesEnum values:
SYMBOL_ALIGNMENT_MASK- log2 of alignmentSYMBOL_PERMISSIONS_MASKSYMBOL_PERMISSIONS_CODESYMBOL_PERMISSIONS_DATASYMBOL_PERMISSIONS_RODATASYMBOL_DEFINITION_MASKSYMBOL_DEFINITION_REGULARSYMBOL_DEFINITION_TENTATIVESYMBOL_DEFINITION_WEAKSYMBOL_DEFINITION_UNDEFINEDSYMBOL_DEFINITION_WEAKUNDEFSYMBOL_SCOPE_MASKSYMBOL_SCOPE_INTERNALSYMBOL_SCOPE_HIDDENSYMBOL_SCOPE_PROTECTEDSYMBOL_SCOPE_DEFAULTSYMBOL_SCOPE_DEFAULT_CAN_BE_HIDDENSYMBOL_COMDATSYMBOL_ALIAS
- See Also:
-
LTOSYMBOL_DEFINITION_TENTATIVE
public static final int LTOSYMBOL_DEFINITION_TENTATIVElto_symbol_attributesEnum values:
SYMBOL_ALIGNMENT_MASK- log2 of alignmentSYMBOL_PERMISSIONS_MASKSYMBOL_PERMISSIONS_CODESYMBOL_PERMISSIONS_DATASYMBOL_PERMISSIONS_RODATASYMBOL_DEFINITION_MASKSYMBOL_DEFINITION_REGULARSYMBOL_DEFINITION_TENTATIVESYMBOL_DEFINITION_WEAKSYMBOL_DEFINITION_UNDEFINEDSYMBOL_DEFINITION_WEAKUNDEFSYMBOL_SCOPE_MASKSYMBOL_SCOPE_INTERNALSYMBOL_SCOPE_HIDDENSYMBOL_SCOPE_PROTECTEDSYMBOL_SCOPE_DEFAULTSYMBOL_SCOPE_DEFAULT_CAN_BE_HIDDENSYMBOL_COMDATSYMBOL_ALIAS
- See Also:
-
LTOSYMBOL_DEFINITION_WEAK
public static final int LTOSYMBOL_DEFINITION_WEAKlto_symbol_attributesEnum values:
SYMBOL_ALIGNMENT_MASK- log2 of alignmentSYMBOL_PERMISSIONS_MASKSYMBOL_PERMISSIONS_CODESYMBOL_PERMISSIONS_DATASYMBOL_PERMISSIONS_RODATASYMBOL_DEFINITION_MASKSYMBOL_DEFINITION_REGULARSYMBOL_DEFINITION_TENTATIVESYMBOL_DEFINITION_WEAKSYMBOL_DEFINITION_UNDEFINEDSYMBOL_DEFINITION_WEAKUNDEFSYMBOL_SCOPE_MASKSYMBOL_SCOPE_INTERNALSYMBOL_SCOPE_HIDDENSYMBOL_SCOPE_PROTECTEDSYMBOL_SCOPE_DEFAULTSYMBOL_SCOPE_DEFAULT_CAN_BE_HIDDENSYMBOL_COMDATSYMBOL_ALIAS
- See Also:
-
LTOSYMBOL_DEFINITION_UNDEFINED
public static final int LTOSYMBOL_DEFINITION_UNDEFINEDlto_symbol_attributesEnum values:
SYMBOL_ALIGNMENT_MASK- log2 of alignmentSYMBOL_PERMISSIONS_MASKSYMBOL_PERMISSIONS_CODESYMBOL_PERMISSIONS_DATASYMBOL_PERMISSIONS_RODATASYMBOL_DEFINITION_MASKSYMBOL_DEFINITION_REGULARSYMBOL_DEFINITION_TENTATIVESYMBOL_DEFINITION_WEAKSYMBOL_DEFINITION_UNDEFINEDSYMBOL_DEFINITION_WEAKUNDEFSYMBOL_SCOPE_MASKSYMBOL_SCOPE_INTERNALSYMBOL_SCOPE_HIDDENSYMBOL_SCOPE_PROTECTEDSYMBOL_SCOPE_DEFAULTSYMBOL_SCOPE_DEFAULT_CAN_BE_HIDDENSYMBOL_COMDATSYMBOL_ALIAS
- See Also:
-
LTOSYMBOL_DEFINITION_WEAKUNDEF
public static final int LTOSYMBOL_DEFINITION_WEAKUNDEFlto_symbol_attributesEnum values:
SYMBOL_ALIGNMENT_MASK- log2 of alignmentSYMBOL_PERMISSIONS_MASKSYMBOL_PERMISSIONS_CODESYMBOL_PERMISSIONS_DATASYMBOL_PERMISSIONS_RODATASYMBOL_DEFINITION_MASKSYMBOL_DEFINITION_REGULARSYMBOL_DEFINITION_TENTATIVESYMBOL_DEFINITION_WEAKSYMBOL_DEFINITION_UNDEFINEDSYMBOL_DEFINITION_WEAKUNDEFSYMBOL_SCOPE_MASKSYMBOL_SCOPE_INTERNALSYMBOL_SCOPE_HIDDENSYMBOL_SCOPE_PROTECTEDSYMBOL_SCOPE_DEFAULTSYMBOL_SCOPE_DEFAULT_CAN_BE_HIDDENSYMBOL_COMDATSYMBOL_ALIAS
- See Also:
-
LTOSYMBOL_SCOPE_MASK
public static final int LTOSYMBOL_SCOPE_MASKlto_symbol_attributesEnum values:
SYMBOL_ALIGNMENT_MASK- log2 of alignmentSYMBOL_PERMISSIONS_MASKSYMBOL_PERMISSIONS_CODESYMBOL_PERMISSIONS_DATASYMBOL_PERMISSIONS_RODATASYMBOL_DEFINITION_MASKSYMBOL_DEFINITION_REGULARSYMBOL_DEFINITION_TENTATIVESYMBOL_DEFINITION_WEAKSYMBOL_DEFINITION_UNDEFINEDSYMBOL_DEFINITION_WEAKUNDEFSYMBOL_SCOPE_MASKSYMBOL_SCOPE_INTERNALSYMBOL_SCOPE_HIDDENSYMBOL_SCOPE_PROTECTEDSYMBOL_SCOPE_DEFAULTSYMBOL_SCOPE_DEFAULT_CAN_BE_HIDDENSYMBOL_COMDATSYMBOL_ALIAS
- See Also:
-
LTOSYMBOL_SCOPE_INTERNAL
public static final int LTOSYMBOL_SCOPE_INTERNALlto_symbol_attributesEnum values:
SYMBOL_ALIGNMENT_MASK- log2 of alignmentSYMBOL_PERMISSIONS_MASKSYMBOL_PERMISSIONS_CODESYMBOL_PERMISSIONS_DATASYMBOL_PERMISSIONS_RODATASYMBOL_DEFINITION_MASKSYMBOL_DEFINITION_REGULARSYMBOL_DEFINITION_TENTATIVESYMBOL_DEFINITION_WEAKSYMBOL_DEFINITION_UNDEFINEDSYMBOL_DEFINITION_WEAKUNDEFSYMBOL_SCOPE_MASKSYMBOL_SCOPE_INTERNALSYMBOL_SCOPE_HIDDENSYMBOL_SCOPE_PROTECTEDSYMBOL_SCOPE_DEFAULTSYMBOL_SCOPE_DEFAULT_CAN_BE_HIDDENSYMBOL_COMDATSYMBOL_ALIAS
- See Also:
-
LTOSYMBOL_SCOPE_HIDDEN
public static final int LTOSYMBOL_SCOPE_HIDDENlto_symbol_attributesEnum values:
SYMBOL_ALIGNMENT_MASK- log2 of alignmentSYMBOL_PERMISSIONS_MASKSYMBOL_PERMISSIONS_CODESYMBOL_PERMISSIONS_DATASYMBOL_PERMISSIONS_RODATASYMBOL_DEFINITION_MASKSYMBOL_DEFINITION_REGULARSYMBOL_DEFINITION_TENTATIVESYMBOL_DEFINITION_WEAKSYMBOL_DEFINITION_UNDEFINEDSYMBOL_DEFINITION_WEAKUNDEFSYMBOL_SCOPE_MASKSYMBOL_SCOPE_INTERNALSYMBOL_SCOPE_HIDDENSYMBOL_SCOPE_PROTECTEDSYMBOL_SCOPE_DEFAULTSYMBOL_SCOPE_DEFAULT_CAN_BE_HIDDENSYMBOL_COMDATSYMBOL_ALIAS
- See Also:
-
LTOSYMBOL_SCOPE_PROTECTED
public static final int LTOSYMBOL_SCOPE_PROTECTEDlto_symbol_attributesEnum values:
SYMBOL_ALIGNMENT_MASK- log2 of alignmentSYMBOL_PERMISSIONS_MASKSYMBOL_PERMISSIONS_CODESYMBOL_PERMISSIONS_DATASYMBOL_PERMISSIONS_RODATASYMBOL_DEFINITION_MASKSYMBOL_DEFINITION_REGULARSYMBOL_DEFINITION_TENTATIVESYMBOL_DEFINITION_WEAKSYMBOL_DEFINITION_UNDEFINEDSYMBOL_DEFINITION_WEAKUNDEFSYMBOL_SCOPE_MASKSYMBOL_SCOPE_INTERNALSYMBOL_SCOPE_HIDDENSYMBOL_SCOPE_PROTECTEDSYMBOL_SCOPE_DEFAULTSYMBOL_SCOPE_DEFAULT_CAN_BE_HIDDENSYMBOL_COMDATSYMBOL_ALIAS
- See Also:
-
LTOSYMBOL_SCOPE_DEFAULT
public static final int LTOSYMBOL_SCOPE_DEFAULTlto_symbol_attributesEnum values:
SYMBOL_ALIGNMENT_MASK- log2 of alignmentSYMBOL_PERMISSIONS_MASKSYMBOL_PERMISSIONS_CODESYMBOL_PERMISSIONS_DATASYMBOL_PERMISSIONS_RODATASYMBOL_DEFINITION_MASKSYMBOL_DEFINITION_REGULARSYMBOL_DEFINITION_TENTATIVESYMBOL_DEFINITION_WEAKSYMBOL_DEFINITION_UNDEFINEDSYMBOL_DEFINITION_WEAKUNDEFSYMBOL_SCOPE_MASKSYMBOL_SCOPE_INTERNALSYMBOL_SCOPE_HIDDENSYMBOL_SCOPE_PROTECTEDSYMBOL_SCOPE_DEFAULTSYMBOL_SCOPE_DEFAULT_CAN_BE_HIDDENSYMBOL_COMDATSYMBOL_ALIAS
- See Also:
-
LTOSYMBOL_SCOPE_DEFAULT_CAN_BE_HIDDEN
public static final int LTOSYMBOL_SCOPE_DEFAULT_CAN_BE_HIDDENlto_symbol_attributesEnum values:
SYMBOL_ALIGNMENT_MASK- log2 of alignmentSYMBOL_PERMISSIONS_MASKSYMBOL_PERMISSIONS_CODESYMBOL_PERMISSIONS_DATASYMBOL_PERMISSIONS_RODATASYMBOL_DEFINITION_MASKSYMBOL_DEFINITION_REGULARSYMBOL_DEFINITION_TENTATIVESYMBOL_DEFINITION_WEAKSYMBOL_DEFINITION_UNDEFINEDSYMBOL_DEFINITION_WEAKUNDEFSYMBOL_SCOPE_MASKSYMBOL_SCOPE_INTERNALSYMBOL_SCOPE_HIDDENSYMBOL_SCOPE_PROTECTEDSYMBOL_SCOPE_DEFAULTSYMBOL_SCOPE_DEFAULT_CAN_BE_HIDDENSYMBOL_COMDATSYMBOL_ALIAS
- See Also:
-
LTOSYMBOL_COMDAT
public static final int LTOSYMBOL_COMDATlto_symbol_attributesEnum values:
SYMBOL_ALIGNMENT_MASK- log2 of alignmentSYMBOL_PERMISSIONS_MASKSYMBOL_PERMISSIONS_CODESYMBOL_PERMISSIONS_DATASYMBOL_PERMISSIONS_RODATASYMBOL_DEFINITION_MASKSYMBOL_DEFINITION_REGULARSYMBOL_DEFINITION_TENTATIVESYMBOL_DEFINITION_WEAKSYMBOL_DEFINITION_UNDEFINEDSYMBOL_DEFINITION_WEAKUNDEFSYMBOL_SCOPE_MASKSYMBOL_SCOPE_INTERNALSYMBOL_SCOPE_HIDDENSYMBOL_SCOPE_PROTECTEDSYMBOL_SCOPE_DEFAULTSYMBOL_SCOPE_DEFAULT_CAN_BE_HIDDENSYMBOL_COMDATSYMBOL_ALIAS
- See Also:
-
LTOSYMBOL_ALIAS
public static final int LTOSYMBOL_ALIASlto_symbol_attributesEnum values:
SYMBOL_ALIGNMENT_MASK- log2 of alignmentSYMBOL_PERMISSIONS_MASKSYMBOL_PERMISSIONS_CODESYMBOL_PERMISSIONS_DATASYMBOL_PERMISSIONS_RODATASYMBOL_DEFINITION_MASKSYMBOL_DEFINITION_REGULARSYMBOL_DEFINITION_TENTATIVESYMBOL_DEFINITION_WEAKSYMBOL_DEFINITION_UNDEFINEDSYMBOL_DEFINITION_WEAKUNDEFSYMBOL_SCOPE_MASKSYMBOL_SCOPE_INTERNALSYMBOL_SCOPE_HIDDENSYMBOL_SCOPE_PROTECTEDSYMBOL_SCOPE_DEFAULTSYMBOL_SCOPE_DEFAULT_CAN_BE_HIDDENSYMBOL_COMDATSYMBOL_ALIAS
- See Also:
-
LTODEBUG_MODEL_NONE
public static final int LTODEBUG_MODEL_NONE- See Also:
-
LTODEBUG_MODEL_DWARF
public static final int LTODEBUG_MODEL_DWARF- See Also:
-
LTOCODEGEN_PIC_MODEL_STATIC
public static final int LTOCODEGEN_PIC_MODEL_STATIClto_codegen_modelEnum values:
- See Also:
-
LTOCODEGEN_PIC_MODEL_DYNAMIC
public static final int LTOCODEGEN_PIC_MODEL_DYNAMIClto_codegen_modelEnum values:
- See Also:
-
LTOCODEGEN_PIC_MODEL_DYNAMIC_NO_PIC
public static final int LTOCODEGEN_PIC_MODEL_DYNAMIC_NO_PIClto_codegen_modelEnum values:
- See Also:
-
LTOCODEGEN_PIC_MODEL_DEFAULT
public static final int LTOCODEGEN_PIC_MODEL_DEFAULTlto_codegen_modelEnum values:
- See Also:
-
LTODS_ERROR
public static final int LTODS_ERRORDiagnostic severity.(
lto_codegen_diagnostic_severity_t)Enum values:
DS_ERRORDS_WARNINGDS_REMARK- Added in LTO_API_VERSION=10.DS_NOTE
- See Also:
-
LTODS_WARNING
public static final int LTODS_WARNINGDiagnostic severity.(
lto_codegen_diagnostic_severity_t)Enum values:
DS_ERRORDS_WARNINGDS_REMARK- Added in LTO_API_VERSION=10.DS_NOTE
- See Also:
-
LTODS_REMARK
public static final int LTODS_REMARKDiagnostic severity.(
lto_codegen_diagnostic_severity_t)Enum values:
DS_ERRORDS_WARNINGDS_REMARK- Added in LTO_API_VERSION=10.DS_NOTE
- See Also:
-
LTODS_NOTE
public static final int LTODS_NOTEDiagnostic severity.(
lto_codegen_diagnostic_severity_t)Enum values:
DS_ERRORDS_WARNINGDS_REMARK- Added in LTO_API_VERSION=10.DS_NOTE
- See Also:
-
-
Method Details
-
getLibrary
public static org.lwjgl.system.SharedLibrary getLibrary()Returns the LTOSharedLibrary. -
nlto_get_version
public static long nlto_get_version()Unsafe version of:get_version -
lto_get_version
Returns a printable string. -
nlto_get_error_message
public static long nlto_get_error_message()Unsafe version of:get_error_message -
lto_get_error_message
Returns the last error string orNULLif last operation was successful. -
nlto_module_is_object_file
public static boolean nlto_module_is_object_file(long path) Unsafe version of:module_is_object_file -
lto_module_is_object_file
Checks if a file is a loadable object file. -
lto_module_is_object_file
Checks if a file is a loadable object file. -
nlto_module_is_object_file_for_target
public static boolean nlto_module_is_object_file_for_target(long path, long target_triple_prefix) Unsafe version of:module_is_object_file_for_target -
lto_module_is_object_file_for_target
public static boolean lto_module_is_object_file_for_target(ByteBuffer path, ByteBuffer target_triple_prefix) Checks if a file is a loadable object compiled for requested target. -
lto_module_is_object_file_for_target
public static boolean lto_module_is_object_file_for_target(CharSequence path, CharSequence target_triple_prefix) Checks if a file is a loadable object compiled for requested target. -
nlto_module_has_objc_category
public static boolean nlto_module_has_objc_category(long mem, long length) Unsafe version of:module_has_objc_category -
lto_module_has_objc_category
Return true ifBuffercontains a bitcode file with ObjC code (category or class) in it. -
nlto_module_is_object_file_in_memory
public static boolean nlto_module_is_object_file_in_memory(long mem, long length) Unsafe version of:module_is_object_file_in_memory -
lto_module_is_object_file_in_memory
Checks if a buffer is a loadable object file. -
nlto_module_is_object_file_in_memory_for_target
public static boolean nlto_module_is_object_file_in_memory_for_target(long mem, long length, long target_triple_prefix) Unsafe version of:module_is_object_file_in_memory_for_target -
lto_module_is_object_file_in_memory_for_target
public static boolean lto_module_is_object_file_in_memory_for_target(ByteBuffer mem, ByteBuffer target_triple_prefix) Checks if a buffer is a loadable object compiled for requested target. -
lto_module_is_object_file_in_memory_for_target
public static boolean lto_module_is_object_file_in_memory_for_target(ByteBuffer mem, CharSequence target_triple_prefix) Checks if a buffer is a loadable object compiled for requested target. -
nlto_module_create
public static long nlto_module_create(long path) Unsafe version of:module_create -
lto_module_create
Loads an object file from disk. ReturnsNULLon error (checkget_error_messagefor details). -
lto_module_create
Loads an object file from disk. ReturnsNULLon error (checkget_error_messagefor details). -
nlto_module_create_from_memory
public static long nlto_module_create_from_memory(long mem, long length) Unsafe version of:module_create_from_memory -
lto_module_create_from_memory
Loads an object file from memory. ReturnsNULLon error (checkget_error_messagefor details). -
nlto_module_create_from_memory_with_path
public static long nlto_module_create_from_memory_with_path(long mem, long length, long path) Unsafe version of:module_create_from_memory_with_path -
lto_module_create_from_memory_with_path
Loads an object file from memory with an extra path argument. ReturnsNULLon error (checkget_error_messagefor details). -
lto_module_create_from_memory_with_path
Loads an object file from memory with an extra path argument. ReturnsNULLon error (checkget_error_messagefor details). -
nlto_module_create_in_local_context
public static long nlto_module_create_in_local_context(long mem, long length, long path) Unsafe version of:module_create_in_local_context -
lto_module_create_in_local_context
Loads an object file in its own context.Loads an object file in its own LLVMContext. This function call is thread-safe. However, modules created this way should not be merged into an
lto_code_gen_tusingcodegen_add_module.Returns
NULLon error (checkget_error_messagefor details). -
lto_module_create_in_local_context
Loads an object file in its own context.Loads an object file in its own LLVMContext. This function call is thread-safe. However, modules created this way should not be merged into an
lto_code_gen_tusingcodegen_add_module.Returns
NULLon error (checkget_error_messagefor details). -
nlto_module_create_in_codegen_context
public static long nlto_module_create_in_codegen_context(long mem, long length, long path, long cg) Unsafe version of:module_create_in_codegen_context -
lto_module_create_in_codegen_context
Loads an object file in the codegen context.Loads an object file into the same context as
cg. The module is safe to add usingcodegen_add_module.Returns
NULLon error (checkget_error_messagefor details). -
lto_module_create_in_codegen_context
Loads an object file in the codegen context.Loads an object file into the same context as
cg. The module is safe to add usingcodegen_add_module.Returns
NULLon error (checkget_error_messagefor details). -
nlto_module_create_from_fd
public static long nlto_module_create_from_fd(int fd, long path, long file_size) Unsafe version of:module_create_from_fd -
lto_module_create_from_fd
Loads an object file from disk. The seek point offdis not preserved. ReturnsNULLon error (checkget_error_messagefor details). -
lto_module_create_from_fd
Loads an object file from disk. The seek point offdis not preserved. ReturnsNULLon error (checkget_error_messagefor details). -
nlto_module_create_from_fd_at_offset
public static long nlto_module_create_from_fd_at_offset(int fd, long path, long file_size, long map_size, long offset) Unsafe version of:module_create_from_fd_at_offset -
lto_module_create_from_fd_at_offset
public static long lto_module_create_from_fd_at_offset(int fd, ByteBuffer path, long file_size, long map_size, long offset) Loads an object file from disk. The seek point offdis not preserved. ReturnsNULLon error (checkget_error_messagefor details). -
lto_module_create_from_fd_at_offset
public static long lto_module_create_from_fd_at_offset(int fd, CharSequence path, long file_size, long map_size, long offset) Loads an object file from disk. The seek point offdis not preserved. ReturnsNULLon error (checkget_error_messagefor details). -
lto_module_dispose
public static void lto_module_dispose(long mod) Frees all memory internally allocated by the module. Upon return thelto_module_tis no longer valid. -
nlto_module_get_target_triple
public static long nlto_module_get_target_triple(long mod) Unsafe version of:module_get_target_triple -
lto_module_get_target_triple
Returns triple string which the object module was compiled under. -
nlto_module_set_target_triple
public static void nlto_module_set_target_triple(long mod, long triple) Unsafe version of:module_set_target_triple -
lto_module_set_target_triple
Sets triple string with which the object will be codegened. -
lto_module_set_target_triple
Sets triple string with which the object will be codegened. -
lto_module_get_num_symbols
public static int lto_module_get_num_symbols(long mod) Returns the number of symbols in the object module. -
nlto_module_get_symbol_name
public static long nlto_module_get_symbol_name(long mod, int index) Unsafe version of:module_get_symbol_name -
lto_module_get_symbol_name
Returns the name of the ith symbol in the object module. -
lto_module_get_symbol_attribute
public static int lto_module_get_symbol_attribute(long mod, int index) Returns the attributes of the ith symbol in the object module. -
nlto_module_get_linkeropts
public static long nlto_module_get_linkeropts(long mod) Unsafe version of:module_get_linkeropts -
lto_module_get_linkeropts
Returns the module's linker options.The linker options may consist of multiple flags. It is the linker's responsibility to split the flags using a platform-specific mechanism.
-
nlto_module_get_macho_cputype
public static boolean nlto_module_get_macho_cputype(long mod, long out_cputype, long out_cpusubtype) Unsafe version of:module_get_macho_cputype -
lto_module_get_macho_cputype
public static boolean lto_module_get_macho_cputype(long mod, IntBuffer out_cputype, IntBuffer out_cpusubtype) If targeting mach-o on darwin, this function gets the CPU type and subtype that will end up being encoded in the mach-o header. These are the values that can be found inmach/machine.h.- Parameters:
out_cputype- must be non-NULLout_cpusubtype- must be non-NULL- Returns:
- true on error (check
get_error_messagefor details). - Since:
- 11,
LTO_API_VERSION=27
-
lto_module_has_ctor_dtor
public static boolean lto_module_has_ctor_dtor(long mod) This function can be used by the linker to check if a given module has any constructor or destructor functions.- Returns:
- true if the module has either the
@llvm.global_ctorsor the@llvm.global_dtorssymbol. Otherwise returns false. - Since:
LTO_API_VERSION=29
-
nlto_codegen_set_diagnostic_handler
public static void nlto_codegen_set_diagnostic_handler(long cg, long handler, long ctxt) Unsafe version of:codegen_set_diagnostic_handler -
lto_codegen_set_diagnostic_handler
public static void lto_codegen_set_diagnostic_handler(long cg, LTODiagnosticHandlerI handler, long ctxt) Set a diagnostic handler and the related context (void *). This is more general thanget_error_message, as the diagnostic handler can be called at anytime within lto. -
lto_codegen_create
public static long lto_codegen_create()Instantiates a code generator. ReturnsNULLon error (checkget_error_messagefor details).All modules added using
codegen_add_modulemust have been created in the same context as the codegen. -
lto_codegen_create_in_local_context
public static long lto_codegen_create_in_local_context()Instantiate a code generator in its own context.Instantiates a code generator in its own context. Modules added via
codegen_add_modulemust have all been created in the same context, usingmodule_create_in_codegen_context. -
lto_codegen_dispose
public static void lto_codegen_dispose(long cg) Frees all code generator and all memory it internally allocated. Upon return thelto_code_gen_tis no longer valid. -
lto_codegen_add_module
public static boolean lto_codegen_add_module(long cg, long mod) Add an object module to the set of modules for which code will be generated. Returns true on error (checkget_error_messagefor details).cgandmodmust both be in the same context. Seecodegen_create_in_local_contextandmodule_create_in_codegen_context. -
lto_codegen_set_module
public static void lto_codegen_set_module(long cg, long mod) Sets the object module for code generation. This will transfer the ownership of the module to the code generator.cgandmodmust both be in the same context. -
lto_codegen_set_debug_model
public static boolean lto_codegen_set_debug_model(long cg, int model) Sets if debug info should be generated. Returns true on error (checkget_error_messagefor details). -
lto_codegen_set_pic_model
public static boolean lto_codegen_set_pic_model(long cg, int model) Sets which PIC code model to generated. Returns true on error (checkget_error_messagefor details). -
nlto_codegen_set_cpu
public static void nlto_codegen_set_cpu(long cg, long cpu) Unsafe version of:codegen_set_cpu -
lto_codegen_set_cpu
Sets the cpu to generate code for. -
lto_codegen_set_cpu
Sets the cpu to generate code for. -
nlto_codegen_set_assembler_path
public static void nlto_codegen_set_assembler_path(long cg, long path) Unsafe version of:codegen_set_assembler_path -
lto_codegen_set_assembler_path
Sets the location of the assembler tool to run. If not set, libLTO will use gcc to invoke the assembler. -
lto_codegen_set_assembler_path
Sets the location of the assembler tool to run. If not set, libLTO will use gcc to invoke the assembler. -
nlto_codegen_set_assembler_args
public static void nlto_codegen_set_assembler_args(long cg, long args, int nargs) Unsafe version of:codegen_set_assembler_args -
lto_codegen_set_assembler_args
public static void lto_codegen_set_assembler_args(long cg, org.lwjgl.PointerBuffer args) Sets extra arguments that libLTO should pass to the assembler. -
nlto_codegen_add_must_preserve_symbol
public static void nlto_codegen_add_must_preserve_symbol(long cg, long symbol) Unsafe version of:codegen_add_must_preserve_symbol -
lto_codegen_add_must_preserve_symbol
Adds to a list of all 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. -
lto_codegen_add_must_preserve_symbol
Adds to a list of all 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. -
nlto_codegen_write_merged_modules
public static boolean nlto_codegen_write_merged_modules(long cg, long path) Unsafe version of:codegen_write_merged_modules -
lto_codegen_write_merged_modules
Writes a new object file at the specified path that contains the merged contents of all modules added so far. Returns true on error (checkget_error_messagefor details). -
lto_codegen_write_merged_modules
Writes a new object file at the specified path that contains the merged contents of all modules added so far. Returns true on error (checkget_error_messagefor details). -
nlto_codegen_compile
public static long nlto_codegen_compile(long cg, long length) Unsafe version of:codegen_compile -
lto_codegen_compile
Generates code for all added modules into one native object file. This callscodegen_optimizethencodegen_compile_optimized.On success returns a pointer to a generated mach-o/ELF buffer and length set to the buffer size. The buffer is owned by the
lto_code_gen_tand will be freed whencodegen_disposeis called, orlto_codegen_compile()is called again. On failure, returnsNULL(checkget_error_messagefor details). -
nlto_codegen_compile_to_file
public static boolean nlto_codegen_compile_to_file(long cg, long name) Unsafe version of:codegen_compile_to_file -
lto_codegen_compile_to_file
public static boolean lto_codegen_compile_to_file(long cg, org.lwjgl.PointerBuffer name) Generates code for all added modules into one native object file. This callscodegen_optimizethencodegen_compile_optimized(instead of returning a generated mach-o/ELF buffer, it writes to a file).The name of the file is written to name. Returns true on error.
-
lto_codegen_optimize
public static boolean lto_codegen_optimize(long cg) Runs optimization for the merged module. Returns true on error. -
nlto_codegen_compile_optimized
public static long nlto_codegen_compile_optimized(long cg, long length) Unsafe version of:codegen_compile_optimized -
lto_codegen_compile_optimized
Generates code for the optimized merged module into one native object file. It will not run any IR optimizations on the merged module.On success returns a pointer to a generated mach-o/ELF buffer and length set to the buffer size. The buffer is owned by the
lto_code_gen_tand will be freed whencodegen_disposeis called, orlto_codegen_compile_optimized()is called again. On failure, returnsNULL(checkget_error_messagefor details). -
lto_api_version
public static int lto_api_version()Returns the runtime API version. -
nlto_set_debug_options
public static void nlto_set_debug_options(long options, int number) Unsafe version of:set_debug_options -
lto_set_debug_options
public static void lto_set_debug_options(org.lwjgl.PointerBuffer options) Parses options immediately, making them available as early as possible.For example during executing
codegen::InitTargetOptionsFromCodeGenFlags. Since parsing shud only happen once, only one ofcodegen_debug_optionsorlto_set_debug_optionsshould be called.- Since:
- 13,
LTO_API_VERSION=28
-
nlto_codegen_debug_options
public static void nlto_codegen_debug_options(long cg, long options) Unsafe version of:codegen_debug_options -
lto_codegen_debug_options
Sets options to help debug codegen bugs.Since parsing should only happen once, only one of
lto_codegen_debug_optionsorset_debug_optionsshould be called.This function takes one or more options separated by spaces. Warning: passing file paths through this function may confuse the argument parser if the paths contain spaces.
-
lto_codegen_debug_options
Sets options to help debug codegen bugs.Since parsing should only happen once, only one of
lto_codegen_debug_optionsorset_debug_optionsshould be called.This function takes one or more options separated by spaces. Warning: passing file paths through this function may confuse the argument parser if the paths contain spaces.
-
nlto_codegen_debug_options_array
public static void nlto_codegen_debug_options_array(long cg, long options, int number) Unsafe version of:codegen_debug_options_array -
lto_codegen_debug_options_array
public static void lto_codegen_debug_options_array(long cg, org.lwjgl.PointerBuffer options) Same ascodegen_debug_options, but takes every option separately through an array.- Since:
- 10, prior to
LTO_API_VERSION=26
-
lto_initialize_disassembler
public static void lto_initialize_disassembler()Initializes LLVM disassemblers. -
lto_codegen_set_should_internalize
public static void lto_codegen_set_should_internalize(long cg, boolean ShouldInternalize) Sets if we should run internalize pass during optimization and code generation. -
lto_codegen_set_should_embed_uselists
public static void lto_codegen_set_should_embed_uselists(long cg, boolean ShouldEmbedUselists) Set whether to embed uselists in bitcode.Sets whether
codegen_write_merged_modulesshould embed uselists in output bitcode. This should be turned on for all-save-tempsoutput. -
nlto_input_create
public static long nlto_input_create(long buffer, long buffer_size, long path) Unsafe version of:input_create -
lto_input_create
Creates an LTO input file from a buffer.The path argument is used for diagnotics as this function otherwise does not know which file the given buffer is associated with.
- Since:
- 10,
LTO_API_VERSION=24
-
lto_input_create
Creates an LTO input file from a buffer.The path argument is used for diagnotics as this function otherwise does not know which file the given buffer is associated with.
- Since:
- 10,
LTO_API_VERSION=24
-
lto_input_dispose
public static void lto_input_dispose(long input) Frees all memory internally allocated by the LTO input file. Upon return thelto_module_tis no longer valid.- Since:
- 10,
LTO_API_VERSION=24
-
lto_input_get_num_dependent_libraries
public static int lto_input_get_num_dependent_libraries(long input) Returns the number of dependent library specifiers for the given LTO input file.- Since:
- 10,
LTO_API_VERSION=24
-
nlto_input_get_dependent_library
public static long nlto_input_get_dependent_library(long input, long index, long size) Unsafe version of:input_get_dependent_library -
lto_input_get_dependent_library
Returns theithdependent library specifier for the given LTO input file. The returned string is not null-terminated.- Since:
- 10,
LTO_API_VERSION=24
-
nlto_runtime_lib_symbols_list
public static long nlto_runtime_lib_symbols_list(long size) Unsafe version of:runtime_lib_symbols_list -
lto_runtime_lib_symbols_list
public static @Nullable org.lwjgl.PointerBuffer lto_runtime_lib_symbols_list()Returns the list oflibcallsymbols that can be generated by LTO that might not be visible from the symbol table of bitcode files.- Since:
- 10,
LTO_API_VERSION=25
-
thinlto_create_codegen
public static long thinlto_create_codegen()Instantiates a ThinLTO code generator. ReturnsNULLon error (check lto_get_error_message() for details).The
ThinLTOCodeGeneratoris 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. -
thinlto_codegen_dispose
public static void thinlto_codegen_dispose(long cg) Frees the generator and all memory it internally allocated. Upon return thethinlto_code_gen_tis no longer valid. -
nthinlto_codegen_add_module
public static void nthinlto_codegen_add_module(long cg, long identifier, long data, int length) Unsafe version of:thinlto_codegen_add_module(long, java.nio.ByteBuffer, java.nio.ByteBuffer) -
thinlto_codegen_add_module
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 thethinlto_code_gen_tit is added to.On failure, returns
NULL(checkget_error_messagefor details). -
thinlto_codegen_add_module
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 thethinlto_code_gen_tit is added to.On failure, returns
NULL(checkget_error_messagefor details). -
thinlto_codegen_process
public static void thinlto_codegen_process(long cg) Optimize and codegen all the modules added to the codegenerator using ThinLTO. Resulting objects are accessible usingthinlto_module_get_object(long, int, org.lwjgl.llvm.LTOObjectBuffer). -
thinlto_module_get_num_objects
public static int thinlto_module_get_num_objects(long 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.
-
nthinlto_module_get_object
public static void nthinlto_module_get_object(long cg, int index, long __functionAddress, long __result) Unsafe version of:thinlto_module_get_object(long, int, org.lwjgl.llvm.LTOObjectBuffer) -
nthinlto_module_get_object
public static void nthinlto_module_get_object(long cg, int index, long __result) Unsafe version of:thinlto_module_get_object(long, int, org.lwjgl.llvm.LTOObjectBuffer) -
thinlto_module_get_object
public static LTOObjectBuffer thinlto_module_get_object(long cg, int index, LTOObjectBuffer __result) Returns a reference to the ith object file produced by the ThinLTO CodeGenerator.Client should use
thinlto_module_get_num_objects(long)to get the number of available objects. -
thinlto_module_get_num_object_files
public static int thinlto_module_get_num_object_files(long 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.
-
nthinlto_module_get_object_file
public static long nthinlto_module_get_object_file(long cg, int index) Unsafe version of:thinlto_module_get_object_file(long, int) -
thinlto_module_get_object_file
Returns the path to the ith object file produced by the ThinLTO CodeGenerator.Client should use
thinlto_module_get_num_object_files(long)to get the number of available objects. -
thinlto_codegen_set_pic_model
public static boolean thinlto_codegen_set_pic_model(long cg, int model) Sets which PIC code model to generate. Returns true on error (checkget_error_messagefor details). -
nthinlto_codegen_set_savetemps_dir
public static void nthinlto_codegen_set_savetemps_dir(long cg, long save_temps_dir) Unsafe version of:thinlto_codegen_set_savetemps_dir(long, java.nio.ByteBuffer) -
thinlto_codegen_set_savetemps_dir
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. -
thinlto_codegen_set_savetemps_dir
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. -
nthinlto_set_generated_objects_dir
public static void nthinlto_set_generated_objects_dir(long cg, long save_temps_dir) Unsafe version of:thinlto_set_generated_objects_dir(long, java.nio.ByteBuffer) -
thinlto_set_generated_objects_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 throughthinlto_module_get_object_file(long, int)instead ofthinlto_module_get_object(long, int, org.lwjgl.llvm.LTOObjectBuffer). -
thinlto_set_generated_objects_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 throughthinlto_module_get_object_file(long, int)instead ofthinlto_module_get_object(long, int, org.lwjgl.llvm.LTOObjectBuffer). -
nthinlto_codegen_set_cpu
public static void nthinlto_codegen_set_cpu(long cg, long cpu) Unsafe version of:thinlto_codegen_set_cpu(long, java.nio.ByteBuffer) -
thinlto_codegen_set_cpu
Sets the cpu to generate code for. -
thinlto_codegen_set_cpu
Sets the cpu to generate code for. -
thinlto_codegen_disable_codegen
public static void thinlto_codegen_disable_codegen(long cg, boolean disable) Disable CodeGen, only run the stages till codegen and stop. The output will be bitcode. -
thinlto_codegen_set_codegen_only
public static void thinlto_codegen_set_codegen_only(long cg, boolean codegen_only) Perform CodeGen only: disable all other stages. -
nthinlto_debug_options
public static void nthinlto_debug_options(long options, int number) Unsafe version of:thinlto_debug_options(org.lwjgl.PointerBuffer) -
thinlto_debug_options
public static void thinlto_debug_options(org.lwjgl.PointerBuffer options) Parse-mllvmstyle debug options. -
lto_module_is_thinlto
public static boolean lto_module_is_thinlto(long mod) Test if a module has support for ThinLTO linking. -
nthinlto_codegen_add_must_preserve_symbol
public static void nthinlto_codegen_add_must_preserve_symbol(long cg, long name, int length) Unsafe version of:thinlto_codegen_add_must_preserve_symbol(long, java.nio.ByteBuffer) -
thinlto_codegen_add_must_preserve_symbol
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. -
thinlto_codegen_add_must_preserve_symbol
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. -
nthinlto_codegen_add_cross_referenced_symbol
public static void nthinlto_codegen_add_cross_referenced_symbol(long cg, long name, int length) Unsafe version of:thinlto_codegen_add_cross_referenced_symbol(long, java.nio.ByteBuffer) -
thinlto_codegen_add_cross_referenced_symbol
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. -
thinlto_codegen_add_cross_referenced_symbol
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. -
nthinlto_codegen_set_cache_dir
public static void nthinlto_codegen_set_cache_dir(long cg, long cache_dir) Unsafe version of:thinlto_codegen_set_cache_dir(long, java.nio.ByteBuffer) -
thinlto_codegen_set_cache_dir
Sets the path to a directory to use as a cache storage for incremental build. Setting this activates caching. -
thinlto_codegen_set_cache_dir
Sets the path to a directory to use as a cache storage for incremental build. Setting this activates caching. -
thinlto_codegen_set_cache_pruning_interval
public static void thinlto_codegen_set_cache_pruning_interval(long cg, int interval) Sets the cache pruning interval (in seconds). A negative value disables the pruning. An unspecified default value will be applied, and a value of 0 will force prunning to occur. -
thinlto_codegen_set_final_cache_size_relative_to_available_space
public static void thinlto_codegen_set_final_cache_size_relative_to_available_space(long cg, int percentage) Sets the maximum cache size that can be persistent across build, in terms of percentage of the available space on 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 -
thinlto_codegen_set_cache_entry_expiration
public static void thinlto_codegen_set_cache_entry_expiration(long cg, int 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. -
thinlto_codegen_set_cache_size_bytes
public static void thinlto_codegen_set_cache_size_bytes(long cg, int max_size_bytes) 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. -
thinlto_codegen_set_cache_size_megabytes
public static void thinlto_codegen_set_cache_size_megabytes(long cg, int max_size_megabytes) Same asthinlto_codegen_set_cache_size_bytes(long, int), except the maximum size is in megabytes (220 bytes). -
thinlto_codegen_set_cache_size_files
public static void thinlto_codegen_set_cache_size_files(long cg, int max_size_files) Sets the maximum number of files in the cache directory. An unspecified default value will be applied. A value of 0 will be ignored.
-