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)
nogcverification 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
- HirTo
Mir - 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.
- MirEnum
Def - MirExpr
- MirFnId
- MirFunction
- MirMatch
Arm - A match arm at MIR level: pattern + body.
- MirParam
- MirProgram
- A MIR program is a collection of functions + struct defs + an entry point.
- MirStruct
Def - MirVariant
Def - TempId
Enums§
- MirExpr
Kind - MirPattern
- A pattern at MIR level.
- MirStmt