Skip to main content

cljrs_ir_viz/
lib.rs

1//! HTML visualizer for clojurust IR.
2//!
3//! Generates a single self-contained HTML file (inline CSS + JS, no external
4//! deps) that shows a function's IR alongside its source, color-coded by
5//! the region-allocation optimizer's output:
6//!
7//! * Each `RegionStart`/`RegionEnd` pair gets a deterministic color; every
8//!   instruction inside the region — and every source line that produced
9//!   one of its `RegionAlloc` insts — is tinted with that color.
10//! * Allocations that *didn't* get promoted to a region are flagged with
11//!   their escape-analysis verdict and a "blamed" use, making it obvious
12//!   why the optimizer left them on the GC heap.
13//!
14//! Hover any IR instruction to highlight its source line; hover any source
15//! line to highlight related IR instructions.
16
17mod blame;
18mod region;
19mod render;
20
21pub use render::{RenderOptions, render_html};