Skip to main content

Crate cjc_mir

Crate cjc_mir 

Source
Expand description

CJC MIR (Mid-level Intermediate Representation)

MIR is a control-flow graph (CFG) of basic blocks. Every value is an explicit temporary. This is the level where:

  • Pattern matching is compiled to decision trees (Stage 2.2)
  • Closures are lambda-lifted (Stage 2.1)
  • nogc verification runs (Stage 2.4)
  • Optimization passes operate (Stage 2.4)

For Milestone 2.0, MIR is a simplified representation that mirrors HIR closely — we lower HIR items into MIR functions with basic blocks for straight-line code, if/else, while, and function calls.

Re-exports§

pub use escape::AllocHint;

Modules§

cfg
CJC MIR Control-Flow Graph (CFG)
dominators
Dominator tree computation and dominance frontiers.
escape
Escape analysis — intraprocedural MIR annotation pass.
inspect
MIR Inspect/Diagnostics — Deterministic text dumps of analysis results
loop_analysis
Loop Analysis — Structured Loop Tree from CFG
monomorph
MIR Monomorphization Pass
nogc_verify
NoGC Static Verifier (Stage 2.4)
optimize
MIR Optimizer (Stage 2.4)
reduction
Reduction Analysis — Detect and classify accumulation patterns in loops
ssa
SSA (Static Single Assignment) form construction and verification.
ssa_loop_overlay
SSA Loop/Reduction Overlay — Connects SSA definitions to loop structure
ssa_optimize
SSA-aware optimizer passes for CFG-form MIR.
verify
MIR Legality Verifier — Determinism and transformation legality checks

Structs§

BlockId
HirToMir
Lowers HIR into MIR.
MirBody
The body of a MIR function — a list of MIR statements. In Milestone 2.0 we use a simplified tree-form (not full CFG with basic blocks). This is extended to a proper CFG in Milestone 2.2+ for pattern matching compilation.
MirEnumDef
MirExpr
MirFnId
MirFunction
MirMatchArm
A match arm at MIR level: pattern + body.
MirParam
MirProgram
A MIR program is a collection of functions + struct defs + an entry point.
MirStructDef
MirVariantDef
TempId

Enums§

MirExprKind
MirPattern
A pattern at MIR level.
MirStmt