Type Alias cairo_lang_lowering::destructs::DestructAdderDemand
source · pub type DestructAdderDemand = Demand<VariableId, (), PanicState>;
Aliased Type§
struct DestructAdderDemand {
pub vars: OrderedHashMap<Id<Variable>, ()>,
pub aux: PanicState,
}
Fields§
§vars: OrderedHashMap<Id<Variable>, ()>
§aux: PanicState
Implementations§
source§impl<Var: Hash + Eq + Copy, UsePosition: Copy, Aux: Clone + Default + AuxCombine> Demand<Var, UsePosition, Aux>
impl<Var: Hash + Eq + Copy, UsePosition: Copy, Aux: Clone + Default + AuxCombine> Demand<Var, UsePosition, Aux>
sourcepub fn finalize(self) -> bool
pub fn finalize(self) -> bool
Finalizes a demand. Returns a boolean representing success - if all the variable demands were satisfied.
sourcepub fn apply_remapping<'a, V: Copy + Into<Var> + 'a, T: DemandReporter<Var, Aux, UsePosition = UsePosition>>(
&mut self,
reporter: &mut T,
remapping: impl Iterator<Item = (&'a V, (&'a V, T::UsePosition))> + DoubleEndedIterator + ExactSizeIterator
)
pub fn apply_remapping<'a, V: Copy + Into<Var> + 'a, T: DemandReporter<Var, Aux, UsePosition = UsePosition>>( &mut self, reporter: &mut T, remapping: impl Iterator<Item = (&'a V, (&'a V, T::UsePosition))> + DoubleEndedIterator + ExactSizeIterator )
Updates the demand when a variable remapping occurs.
sourcepub fn variables_used<'a, V: Copy + Into<Var> + 'a, T: DemandReporter<Var, Aux, UsePosition = UsePosition>>(
&mut self,
reporter: &mut T,
vars: impl Iterator<Item = (&'a V, T::UsePosition)> + DoubleEndedIterator + ExactSizeIterator
)
pub fn variables_used<'a, V: Copy + Into<Var> + 'a, T: DemandReporter<Var, Aux, UsePosition = UsePosition>>( &mut self, reporter: &mut T, vars: impl Iterator<Item = (&'a V, T::UsePosition)> + DoubleEndedIterator + ExactSizeIterator )
Updates the demand when some variables are used right before the current flow.
sourcepub fn variables_introduced<V: Copy + Into<Var>, T: DemandReporter<Var, Aux>>(
&mut self,
reporter: &mut T,
vars: &[V],
position: T::IntroducePosition
)
pub fn variables_introduced<V: Copy + Into<Var>, T: DemandReporter<Var, Aux>>( &mut self, reporter: &mut T, vars: &[V], position: T::IntroducePosition )
Updates the demand when some variables are introduced right before the current flow.
sourcepub fn merge_demands<T: DemandReporter<Var, Aux>>(
demands: &[(Self, T::IntroducePosition)],
reporter: &mut T
) -> Self
pub fn merge_demands<T: DemandReporter<Var, Aux>>( demands: &[(Self, T::IntroducePosition)], reporter: &mut T ) -> Self
Merges Demands from multiple branches into one, reporting diagnostics in the way.