Crate gruel_codegen_llvm

Crate gruel_codegen_llvm 

Source
Expand description

LLVM-based code generation for the Gruel compiler.

This crate converts CFG (Control Flow Graph) to native object code via LLVM IR, using the inkwell crate as safe Rust bindings to LLVM’s C API.

§Build requirements

LLVM 22 must be installed and LLVM_SYS_221_PREFIX or a system llvm-config must be available.

  • On macOS: brew install llvm
  • On Linux: apt install llvm-22-dev

§Pipeline

CFG → LLVM IR (via inkwell) → [opt passes] → object file bytes

Functions§

generate
Generate a native object file from a collection of function CFGs using LLVM.
generate_ir
Generate LLVM textual IR from a collection of function CFGs.