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 bytesStructs§
- Codegen
Inputs - Inputs to LLVM codegen, bundled to keep function signatures readable.
Enums§
- OptLevel
- Optimization level, following standard compiler conventions.
Functions§
- compile_
bitcode_ to_ object - Compile cached or freshly-emitted LLVM bitcode into a native object file.
- generate
- Generate a native object file from a collection of function CFGs using LLVM.
- generate_
bitcode - Generate pre-optimization LLVM bitcode from a collection of function CFGs.
- generate_
ir - Generate LLVM textual IR from a collection of function CFGs.