Skip to main content

IR

Struct IR 

Source
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 Registry with 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: Registry

The 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.

Trait Implementations§

Source§

impl Debug for IR

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl Freeze for IR

§

impl RefUnwindSafe for IR

§

impl Send for IR

§

impl Sync for IR

§

impl Unpin for IR

§

impl UnsafeUnpin for IR

§

impl UnwindSafe for IR

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.