Top Inners Fields Constructors Methods
org.lwjgl.llvm

public Class LLVMLTO

extends Object
Class Inheritance
Imports
javax.annotation.*, java.nio.*, org.lwjgl.*, org.lwjgl.system.*

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static class
LLVMLTO.Functions

Contains the function pointers loaded from the LTO SharedLibrary.

Field Summary

Modifier and TypeField and Description
private static final SharedLibrary
public static final int
public static final int
public static final int
public static final int
public static final int
public static final int
public static final int
public static final int
LTODS_ERROR

Diagnostic severity.

public static final int
LTODS_NOTE

Diagnostic severity.

public static final int
LTODS_REMARK

Diagnostic severity.

public static final int
LTODS_WARNING

Diagnostic severity.

public static final int
public static final int
public static final int
public static final int
public static final int
public static final int
public static final int
public static final int
public static final int
public static final int
public static final int
public static final int
public static final int
public static final int
public static final int
public static final int
public static final int
public static final int
public static final int

Constructor Summary

AccessConstructor and Description
protected

Method Summary

Modifier and TypeMethod and Description
public static SharedLibrary
getLibrary()

Returns the LTO SharedLibrary.

public static int
lto_api_version()

Returns the runtime API version.

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.

public static void
lto_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.

public static void
lto_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.

public static ByteBuffer
lto_codegen_compile(long cg)

Generates code for all added modules into one native object file.

public static ByteBuffer
lto_codegen_compile_optimized(long cg)

Generates code for the optimized merged module into one native object file.

public static boolean
lto_codegen_compile_to_file(long cg, PointerBuffer name)

Generates code for all added modules into one native object file.

public static long
lto_codegen_create()

Instantiates a code generator.

public static long
lto_codegen_create_in_local_context()

Instantiate a code generator in its own context.

public static void
lto_codegen_debug_options(long cg, ByteBuffer options)

Sets options to help debug codegen bugs.

public static void
lto_codegen_debug_options(long cg, CharSequence options)

Sets options to help debug codegen bugs.

public static void
lto_codegen_debug_options_array(long cg, PointerBuffer options)

Same as codegen_debug_options, but takes every option separately through an array.

public static void
lto_codegen_dispose(long cg)

Frees all code generator and all memory it internally allocated.

public static boolean
lto_codegen_optimize(long cg)

Runs optimization for the merged module.

public static void
lto_codegen_set_assembler_args(long cg, PointerBuffer args)

Sets extra arguments that libLTO should pass to the assembler.

public static void
lto_codegen_set_assembler_path(long cg, ByteBuffer path)

Sets the location of the assembler tool to run.

public static void
lto_codegen_set_assembler_path(long cg, CharSequence path)

Sets the location of the assembler tool to run.

public static void
lto_codegen_set_cpu(long cg, ByteBuffer cpu)

Sets the cpu to generate code for.

public static void
lto_codegen_set_cpu(long cg, CharSequence cpu)

Sets the cpu to generate code for.

public static boolean
lto_codegen_set_debug_model(long cg, int model)

Sets if debug info should be generated.

public static void
lto_codegen_set_diagnostic_handler(long cg, LTODiagnosticHandlerI handler, long ctxt)

Set a diagnostic handler and the related context (void *).

public static void
lto_codegen_set_module(long cg, long mod)

Sets the object module for code generation.

public static boolean
lto_codegen_set_pic_model(long cg, int model)

Sets which PIC code model to generated.

public static void
lto_codegen_set_should_embed_uselists(long cg, boolean ShouldEmbedUselists)

Set whether to embed uselists in bitcode.

public static void
lto_codegen_set_should_internalize(long cg, boolean ShouldInternalize)

Sets if we should run internalize pass during optimization and code generation.

public static boolean
lto_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.

public static boolean
lto_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.

public static String
lto_get_error_message()

Returns the last error string or NULL if last operation was successful.

public static String
lto_get_version()

Returns a printable string.

public static void
lto_initialize_disassembler()

Initializes LLVM disassemblers.

public static long
lto_input_create(ByteBuffer buffer, ByteBuffer path)

Creates an LTO input file from a buffer.

public static long
lto_input_create(ByteBuffer buffer, CharSequence path)

Creates an LTO input file from a buffer.

public static void
lto_input_dispose(long input)

Frees all memory internally allocated by the LTO input file.

public static String
lto_input_get_dependent_library(long input, long index)

Returns the ith dependent library specifier for the given LTO input file.

public static int
lto_input_get_num_dependent_libraries(long input)

Returns the number of dependent library specifiers for the given LTO input file.

public static long
lto_module_create(ByteBuffer path)

Loads an object file from disk.

public static long
lto_module_create(CharSequence path)

Loads an object file from disk.

public static long
lto_module_create_from_fd(int fd, ByteBuffer path, long file_size)

Loads an object file from disk.

public static long
lto_module_create_from_fd(int fd, CharSequence path, long file_size)

Loads an object file from disk.

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.

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.

public static long
lto_module_create_from_memory(ByteBuffer mem)

Loads an object file from memory.

public static long
lto_module_create_from_memory_with_path(ByteBuffer mem, ByteBuffer path)

Loads an object file from memory with an extra path argument.

public static long
lto_module_create_from_memory_with_path(ByteBuffer mem, CharSequence path)

Loads an object file from memory with an extra path argument.

public static long
lto_module_create_in_codegen_context(ByteBuffer mem, ByteBuffer path, long cg)

Loads an object file in the codegen context.

public static long
lto_module_create_in_codegen_context(ByteBuffer mem, CharSequence path, long cg)

Loads an object file in the codegen context.

public static long
lto_module_create_in_local_context(ByteBuffer mem, ByteBuffer path)

Loads an object file in its own context.

public static long
lto_module_create_in_local_context(ByteBuffer mem, CharSequence path)

Loads an object file in its own context.

public static void
lto_module_dispose(long mod)

Frees all memory internally allocated by the module.

public static String
lto_module_get_linkeropts(long mod)

Returns the module's linker options.

public static boolean

Returns:

true on error (check get_error_message for details).
lto_module_get_macho_cputype
(long mod, IntBuffer
must be non-NULL
out_cputype
,
IntBuffer
must be non-NULL
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.

public static int
lto_module_get_num_symbols(long mod)

Returns the number of symbols in the object module.

public static int
lto_module_get_symbol_attribute(long mod, int index)

Returns the attributes of the ith symbol in the object module.

public static String
lto_module_get_symbol_name(long mod, int index)

Returns the name of the ith symbol in the object module.

public static String
lto_module_get_target_triple(long mod)

Returns triple string which the object module was compiled under.

public static boolean

Returns:

true if the module has either the @llvm.global_ctors or the @llvm.global_dtors symbol. Otherwise returns false.
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.

public static boolean
lto_module_has_objc_category(ByteBuffer mem)

Return true if Buffer contains a bitcode file with ObjC code (category or class) in it.

public static boolean
lto_module_is_object_file(ByteBuffer path)

Checks if a file is a loadable object file.

public static boolean
lto_module_is_object_file(CharSequence path)

Checks if a file is a loadable object file.

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.

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.

public static boolean
lto_module_is_object_file_in_memory(ByteBuffer mem)

Checks if a buffer is a loadable object file.

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.

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.

public static boolean
lto_module_is_thinlto(long mod)

Test if a module has support for ThinLTO linking.

public static void
lto_module_set_target_triple(long mod, ByteBuffer triple)

Sets triple string with which the object will be codegened.

public static void
lto_module_set_target_triple(long mod, CharSequence triple)

Sets triple string with which the object will be codegened.

public static PointerBuffer
lto_runtime_lib_symbols_list()

Returns the list of libcall symbols that can be generated by LTO that might not be visible from the symbol table of bitcode files.

public static void
lto_set_debug_options(PointerBuffer options)

Parses options immediately, making them available as early as possible.

public static void
public static long
nlto_codegen_compile(long cg, long length)

Unsafe version of: codegen_compile

public static long
nlto_codegen_compile_optimized(long cg, long length)

Unsafe version of: codegen_compile_optimized

public static boolean
nlto_codegen_compile_to_file(long cg, long name)

Unsafe version of: codegen_compile_to_file

public static void
nlto_codegen_debug_options(long cg, long options)

Unsafe version of: codegen_debug_options

public static void
nlto_codegen_debug_options_array(long cg, long options, int number)

Unsafe version of: codegen_debug_options_array

public static void
nlto_codegen_set_assembler_args(long cg, long args, int nargs)

Unsafe version of: codegen_set_assembler_args

public static void
nlto_codegen_set_assembler_path(long cg, long path)

Unsafe version of: codegen_set_assembler_path

public static void
nlto_codegen_set_cpu(long cg, long cpu)

Unsafe version of: codegen_set_cpu

public static void
nlto_codegen_set_diagnostic_handler(long cg, long handler, long ctxt)

Unsafe version of: codegen_set_diagnostic_handler

public static boolean
public static long
public static long
nlto_get_version()

Unsafe version of: get_version

public static long
nlto_input_create(long buffer, long buffer_size, long path)

Unsafe version of: input_create

public static long
nlto_input_get_dependent_library(long input, long index, long size)

Unsafe version of: input_get_dependent_library

public static long
nlto_module_create(long path)

Unsafe version of: module_create

public static long
nlto_module_create_from_fd(int fd, long path, long file_size)

Unsafe version of: module_create_from_fd

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

public static long
nlto_module_create_from_memory(long mem, long length)

Unsafe version of: module_create_from_memory

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

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

public static long
nlto_module_create_in_local_context(long mem, long length, long path)

Unsafe version of: module_create_in_local_context

public static long
public static boolean
nlto_module_get_macho_cputype(long mod, long out_cputype, long out_cpusubtype)

Unsafe version of: module_get_macho_cputype

public static long
nlto_module_get_symbol_name(long mod, int index)

Unsafe version of: module_get_symbol_name

public static long
public static boolean
nlto_module_has_objc_category(long mem, long length)

Unsafe version of: module_has_objc_category

public static boolean
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

public static boolean
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

public static void
nlto_module_set_target_triple(long mod, long triple)

Unsafe version of: module_set_target_triple

public static long
public static void
nlto_set_debug_options(long options, int number)

Unsafe version of: set_debug_options

public static void
public static void
nthinlto_codegen_add_module(long cg, long identifier, long data, int length)

Unsafe version of: thinlto_codegen_add_module

public static void
public static void
nthinlto_codegen_set_cache_dir(long cg, long cache_dir)

Unsafe version of: thinlto_codegen_set_cache_dir

public static void
nthinlto_codegen_set_cpu(long cg, long cpu)

Unsafe version of: thinlto_codegen_set_cpu

public static void
nthinlto_codegen_set_savetemps_dir(long cg, long save_temps_dir)

Unsafe version of: thinlto_codegen_set_savetemps_dir

public static void
nthinlto_debug_options(long options, int number)

Unsafe version of: thinlto_debug_options

public static native void
nthinlto_module_get_object(long cg, int index, long __functionAddress, long __result)

Unsafe version of: thinlto_module_get_object

public static void
nthinlto_module_get_object(long cg, int index, long __result)

Unsafe version of: thinlto_module_get_object

public static long
public static void
nthinlto_set_generated_objects_dir(long cg, long save_temps_dir)

Unsafe version of: thinlto_set_generated_objects_dir

public static void
thinlto_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.

public static void
thinlto_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.

public static void
thinlto_codegen_add_module(long cg, ByteBuffer identifier, ByteBuffer data)

Add a module to a ThinLTO code generator.

public static void
thinlto_codegen_add_module(long cg, CharSequence identifier, ByteBuffer data)

Add a module to a ThinLTO code generator.

public static void
thinlto_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.

public static void
thinlto_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.

public static void
thinlto_codegen_disable_codegen(long cg, boolean disable)

Disable CodeGen, only run the stages till codegen and stop.

public static void
thinlto_codegen_dispose(long cg)

Frees the generator and all memory it internally allocated.

public static void
thinlto_codegen_process(long cg)

Optimize and codegen all the modules added to the codegenerator using ThinLTO.

public static void
thinlto_codegen_set_cache_dir(long cg, ByteBuffer cache_dir)

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

public static void
thinlto_codegen_set_cache_dir(long cg, CharSequence cache_dir)

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

public static void
thinlto_codegen_set_cache_entry_expiration(long cg, int expiration)

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

public static void
thinlto_codegen_set_cache_pruning_interval(long cg, int interval)

Sets the cache pruning interval (in seconds).

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).

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.

public static void
thinlto_codegen_set_cache_size_megabytes(long cg, int max_size_megabytes)

Same as thinlto_codegen_set_cache_size_bytes, except the maximum size is in megabytes (220 bytes).

public static void
thinlto_codegen_set_codegen_only(long cg, boolean codegen_only)

Perform CodeGen only: disable all other stages.

public static void
thinlto_codegen_set_cpu(long cg, ByteBuffer cpu)

Sets the cpu to generate code for.

public static void
thinlto_codegen_set_cpu(long cg, CharSequence cpu)

Sets the cpu to generate code for.

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.

public static boolean
thinlto_codegen_set_pic_model(long cg, int model)

Sets which PIC code model to generate.

public static void
thinlto_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.

public static void
thinlto_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.

public static long
thinlto_create_codegen()

Instantiates a ThinLTO code generator.

public static void
thinlto_debug_options(PointerBuffer options)

Parse -mllvm style debug options.

public static int
thinlto_module_get_num_object_files(long cg)

Returns the number of object files produced by the ThinLTO CodeGenerator.

public static int
thinlto_module_get_num_objects(long cg)

Returns the number of object files produced by the ThinLTO CodeGenerator.

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.

public static String
thinlto_module_get_object_file(long cg, int index)

Returns the path to the ith object file produced by the ThinLTO CodeGenerator.

public static void
thinlto_set_generated_objects_dir(long cg, ByteBuffer save_temps_dir)

Set the path to a directory where to save generated object files.

public static void
thinlto_set_generated_objects_dir(long cg, CharSequence save_temps_dir)

Set the path to a directory where to save generated object files.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait