Skip to main content

Module dump

Module dump 

Source
Expand description

Textual IR dump — turns a Vec<TopLevel> into a stable, human-readable representation. Used by aver compile --emit-ir and --emit-ir-after=PASS to give compiler engineers a verifiable diff between passes.

The format is Aver-like surface syntax with explicit “this came from a pass” markers in the expression body:

<tail-call:fn>(args) — Expr::TailCall (TCO output) <resolved> — Expr::Resolved (resolver output) __buf_* / __to_str — buffer-build / interp_lower intrinsics

When an AnalysisResult is available (the pipeline’s Analyze stage ran), each FnDef line also carries the per-fn facts:

[no_alloc] — proven not to allocate under the configured policy [locals=N] — resolver’s local_count [body=kind] — body shape from the thin-body classifier

Expression rendering reuses checker::verify::expr_to_str. Top-level scaffolding (fn signatures, stmt list, type defs, module headers) lives here. The analysis itself lives in ir::analyze — dump is read-only over its result, which keeps compute-once / read-many honest.

Functions§

dump_items
Render every top-level item in items, separated by blank lines. Pass analysis: None for dumps before the Analyze stage has run (or when running passes individually); FnDef lines will then omit the [...] annotation block but the IR itself still renders.