Function LLVMCreateMCJITCompilerForModule

Source
pub unsafe extern "C" fn LLVMCreateMCJITCompilerForModule(
    OutJIT: *mut *mut LLVMOpaqueExecutionEngine,
    M: *mut LLVMModule,
    Options: *mut LLVMMCJITCompilerOptions,
    SizeOfOptions: usize,
    OutError: *mut *mut i8,
) -> i32
Expand description

Create an MCJIT execution engine for a module, with the given options.

It is the responsibility of the caller to ensure that all fields in Options up to the given SizeOfOptions are initialized. It is correct to pass a smaller value of SizeOfOptions that omits some fields. The canonical way of using this is:

LLVMMCJITCompilerOptions options;
LLVMInitializeMCJITCompilerOptions(&options, sizeof(options));
// ... fill in those options you care about
LLVMCreateMCJITCompilerForModule(&jit, mod, &options, sizeof(options),
                                 &error);

Note that this is also correct, though possibly suboptimal:

LLVMCreateMCJITCompilerForModule(&jit, mod, 0, 0, &error);

0 is returned on success, or 1 on failure.