Enum debris_llir::llir_nodes::Condition
source · pub enum Condition {
Compare {
lhs: ScoreboardValue,
rhs: ScoreboardValue,
comparison: ScoreboardComparison,
},
And(Vec<Condition>),
Or(Vec<Condition>),
}
Expand description
Evaluates a condition and returns either true or false
Variants§
Implementations§
source§impl Condition
impl Condition
sourcepub fn not(&self) -> Condition
pub fn not(&self) -> Condition
Returns a condition that is true, when this condition is false and the other way around
sourcepub fn is_effect_free(&self) -> bool
pub fn is_effect_free(&self) -> bool
Returns whether evaluating this condition has any side effects
sourcepub fn is_simple(&self) -> bool
pub fn is_simple(&self) -> bool
Checks whether this condition is “simple”, which means that it is not expensive to use this condition multiple times instead of a boolean.
Right now, only Condition::Compare
is considered simple.
pub fn variable_reads(&self) -> FxHashSet<ItemId>
sourcepub fn variable_accesses<F: FnMut(VariableAccess<'_>)>(&self, visitor: &mut F)
pub fn variable_accesses<F: FnMut(VariableAccess<'_>)>(&self, visitor: &mut F)
Recursively yields all variables that this condition reads from
pub fn variable_accesses_mut<F: FnMut(VariableAccessMut<'_>)>( &mut self, visitor: &mut F )
Trait Implementations§
source§impl PartialEq for Condition
impl PartialEq for Condition
impl Eq for Condition
impl StructuralEq for Condition
impl StructuralPartialEq for Condition
Auto Trait Implementations§
impl RefUnwindSafe for Condition
impl Send for Condition
impl Sync for Condition
impl Unpin for Condition
impl UnwindSafe for Condition
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.