Skip to main content

Module program

Module program 

Source
Expand description

MirProgram + MirFn — the top-level shape of Core MIR.

Phase 2a of #252. The data model is structured (not flat / basic-block), expression-based (every MirExpr is a value), and identity-typed (declaration refs go through FnId / TypeId / CtorId). See [super::RFC.md] for the full rationale.

Structs§

LocalId
Local binding identifier. Unique per function body (not per program) — backends look up the binding by walking the body’s Let chain, so collision across functions isn’t a concern.
MirFn
One function in Core MIR. Body is a single MirExpr — MIR is expression-based, so the function’s body is the expression that produces its return value. Let chains within the body bind intermediate results; there’s no separate “block” or “terminator” concept at this phase.
MirFnRepr
Per-fn Int-representation summary made explicit on the rewritten MIR (ETAP-2 SLICE 1). Default-empty ⇒ everything is the arbitrary-precision Int (aver_rt::AverInt), the fail-closed baseline. Populated only by bare_i64::rewrite_for_rust.
MirParam
One formal parameter. The LocalId is assigned at lowering time and is the binding the function body refers to.
MirProgram
A whole compiled program in Core MIR. Keyed by FnId (stable across compilation units; same identity layer the rest of the pipeline consumes). Phase 2a builds an empty MirProgram directly; Phase 3 grows the lowering that populates it from ResolvedProgramView.