Skip to main content

compile_bitcode_to_object

Function compile_bitcode_to_object 

Source
pub fn compile_bitcode_to_object(
    bitcode: &[u8],
    opt_level: OptLevel,
    target: &Target,
) -> CompileResult<Vec<u8>>
Expand description

Compile cached or freshly-emitted LLVM bitcode into a native object file.

Runs the LLVM mid-end optimizer pipeline at the given level (no-op at -O0) and emits an object via the host machine’s back-end. Used by ADR-0074’s bitcode cache to consume the output of either generate_bitcode (cache miss) or a previously cached .bc blob (cache hit).