Skip to main content

Crate nova_codegen_cranelift

Crate nova_codegen_cranelift 

Source
Expand description

Cranelift codegen backend for Nova (the fast debug backend).

Translates monomorphized MIR into native code, through two paths:

  • compile_jit: in-memory JIT for nova run — runtime symbols are registered directly with the JIT.
  • compile_object: native object bytes for nova build — the MIR entry is emitted as nova_main plus an exported C main(argc, argv) wrapper, and runtime symbols resolve at link time against the nova-runtime static library.

MIR temps become Cranelift frontend Variables, so the SSA builder inserts block parameters (phis) at join points automatically. Unit-class temps carry no runtime value and are never materialized.

Structs§

CompiledProgram
A JIT-compiled Nova program, ready to run in-process.
UnresolvedExternSymbol
An extern symbol the JIT could not resolve at run time. This is a user error (a bad FFI declaration), not a compiler bug, so the driver reports it as a clean diagnostic rather than an internal error.

Constants§

NOVA_ENTRY_SYMBOL
The symbol name the MIR main gets in object files, so the exported C-ABI main(argc, argv) wrapper can keep the conventional name.

Functions§

compile_jit
JIT-compile a MIR module and return the runnable program.
compile_object
Compile a MIR module to native object-file bytes for nova build.
lower_module
Lower a typed HIR module to monomorphized MIR.
mangle
Mangle a function instance into a unique symbol name.