pub struct IR {Show 17 fields
pub registry: Registry,
pub consts: Vec<ConstEntry>,
pub params: Vec<ParamEntry>,
pub nodes: Vec<NodeEntry>,
pub asserts: Vec<AssertEntry>,
pub plots: Vec<PlotEntry>,
pub figures: Vec<FigureEntry>,
pub layers: Vec<LayerEntry>,
pub included_plots: Vec<IncludedPlotEntry>,
pub source_order: Vec<(ScopedName, DeclCategory)>,
pub assert_names: HashSet<ScopedName>,
pub assumes_map: HashMap<ScopedName, Vec<ScopedName>>,
pub expected_fail: HashMap<ScopedName, ExpectedFail>,
pub imported_values: HashMap<ScopedName, (RuntimeValue, DeclaredType)>,
pub imported_decl_types: HashMap<ScopedName, DeclaredType>,
pub imported_value_sources: HashMap<ScopedName, ImportedValueSource>,
pub pub_names: HashSet<DeclName>,
}Expand description
Intermediate Representation produced by lower.
Contains everything downstream stages need:
- A
Registrywith dimensions, units, indexes, structs, and functions - Declarations (consts, params, nodes) with their expressions
- Dependency graphs for const and runtime evaluation ordering
- Source-order tracking for deterministic output
Fields§
§registry: RegistryThe type/unit/dimension/index/struct/function registry.
consts: Vec<ConstEntry>Const declarations in source order.
params: Vec<ParamEntry>Param declarations in source order.
nodes: Vec<NodeEntry>Node declarations in source order.
asserts: Vec<AssertEntry>Assert declarations in source order.
plots: Vec<PlotEntry>Plot declarations in source order.
figures: Vec<FigureEntry>Figure declarations in source order.
layers: Vec<LayerEntry>Layer declarations in source order.
included_plots: Vec<IncludedPlotEntry>Plot aliases from include brace lists (#847).
source_order: Vec<(ScopedName, DeclCategory)>All declaration names in source order with their category.
assert_names: HashSet<ScopedName>Set of all assert names.
assumes_map: HashMap<ScopedName, Vec<ScopedName>>Mapping from assert name to the list of declarations that assume it.
expected_fail: HashMap<ScopedName, ExpectedFail>Mapping from assert name to its expected-fail configuration.
imported_values: HashMap<ScopedName, (RuntimeValue, DeclaredType)>Pre-evaluated values imported from dependency files.
These are injected directly into the execution plan rather than compiled.
Each entry carries the runtime value and its declared type (for dim_check).
imported_decl_types: HashMap<ScopedName, DeclaredType>Declared types for imported names that are not backed by a pre-evaluated value at this compilation boundary.
Inline DAG bodies use this for import parent.{const}: the body needs
the imported name’s type during dim-checking, while the concrete value is
supplied later by the caller or by the dependency that owns the DAG.
imported_value_sources: HashMap<ScopedName, ImportedValueSource>Source bindings for imported values whose runtime value is supplied outside this IR.
pub_names: HashSet<DeclName>Names of declarations marked pub (or pub(bind)) in the file.
Carried through from the resolver so downstream stages — most
notably preprocess_dag_body_self_imports — can enforce
visibility on import <self>.{...} items: a dag inside a file
can only reach the file’s pub-marked top-level declarations,
matching the rules for cross-file imports. Implicit visibility
(params are visible by default) is already baked in.