Skip to main content

gruel_rir/
lib.rs

1//! Gruel Intermediate Representation (RIR) - Untyped IR.
2//!
3//! RIR is the first IR in the Gruel compiler pipeline. It is generated from
4//! the AST and represents a lowered, linearized form of the program.
5//!
6//! Key characteristics:
7//! - Untyped: type information is not yet resolved
8//! - Per-file: generated for each source file
9//! - Dense encoding: instructions stored in arrays, referenced by index
10//!
11//! Inspired by Zig's ZIR (Zig Intermediate Representation).
12
13mod astgen;
14pub mod inst;
15mod print;
16
17pub use astgen::AstGen;
18pub use inst::{
19    FunctionSpan, Inst, InstData, InstRef, Rir, RirArgMode, RirCallArg, RirDestructureField,
20    RirDirective, RirFunctionView, RirLinkMode, RirParam, RirParamMode, RirPattern,
21    RirPatternBinding, RirStructPatternBinding,
22};
23pub use print::RirPrinter;