generate

Function generate 

Source
pub fn generate(
    functions: &[&Cfg],
    type_pool: &TypeInternPool,
    strings: &[String],
    interner: &ThreadedRodeo,
    opt_level: OptLevel,
) -> CompileResult<Vec<u8>>
Expand description

Generate a native object file from a collection of function CFGs using LLVM.

All functions are compiled into a single LLVM module, which is then lowered to an object file via LLVM’s backend. The returned bytes can be written to a .o file and passed to a system linker.

At -O1 and above the LLVM mid-end pipeline (default<OX>) is run before emission, enabling InstCombine, GVN, SCCP, ADCE, SimplifyCFG, and more.

§Errors

Returns an error if an LLVM compilation error occurs.