Enum debris_llir::llir_nodes::Node
source · pub enum Node {
FastStore(FastStore),
FastStoreFromResult(FastStoreFromResult),
BinaryOperation(BinaryOperation),
Call(Call),
Condition(Condition),
Branch(Branch),
Execute(ExecuteRaw),
Write(WriteMessage),
Nop,
}
Expand description
Any node
Variants§
FastStore(FastStore)
FastStoreFromResult(FastStoreFromResult)
BinaryOperation(BinaryOperation)
Call(Call)
Condition(Condition)
Branch(Branch)
Execute(ExecuteRaw)
Write(WriteMessage)
Nop
Does nothing
Implementations§
source§impl Node
impl Node
sourcepub fn scan<F>(&self, func: &mut F)where
F: FnMut(&Node),
pub fn scan<F>(&self, func: &mut F)where F: FnMut(&Node),
Iterates over this node and all other nodes that
this node contains.
Changing this function also requires changing Node::scan_mut
sourcepub fn scan_mut<F>(&mut self, func: &mut F)where
F: FnMut(&mut Node),
pub fn scan_mut<F>(&mut self, func: &mut F)where F: FnMut(&mut Node),
A copy of the above function, but with mutability enabled …
sourcepub fn is_effect_free<'a, 'b: 'a, T>(&'a self, function_map: &'b T) -> boolwhere
T: Index<&'a BlockId, Output = Function>,
pub fn is_effect_free<'a, 'b: 'a, T>(&'a self, function_map: &'b T) -> boolwhere T: Index<&'a BlockId, Output = Function>,
Returns whether this command has no side effect. sometimes its easier to just to restrict the parameter to a specific type…
sourcepub fn variable_accesses<F: FnMut(VariableAccess<'_>)>(&self, visitor: &mut F)
pub fn variable_accesses<F: FnMut(VariableAccess<'_>)>(&self, visitor: &mut F)
Accepts a callback function as argument and calls it with every variable accessed by this node.
sourcepub fn variable_accesses_mut<F: FnMut(VariableAccessMut<'_>)>(
&mut self,
visitor: &mut F
)
pub fn variable_accesses_mut<F: FnMut(VariableAccessMut<'_>)>( &mut self, visitor: &mut F )
See variable_accesses
.
sourcepub fn reads_from(&self, item_id: ItemId) -> bool
pub fn reads_from(&self, item_id: ItemId) -> bool
Whether this node has a read-dependency on item_id
Trait Implementations§
source§impl Extend<Node> for PeepholeOptimizer
impl Extend<Node> for PeepholeOptimizer
source§fn extend<T: IntoIterator<Item = Node>>(&mut self, iter: T)
fn extend<T: IntoIterator<Item = Node>>(&mut self, iter: T)
Extends a collection with the contents of an iterator. Read more
source§fn extend_one(&mut self, item: A)
fn extend_one(&mut self, item: A)
🔬This is a nightly-only experimental API. (
extend_one
)Extends a collection with exactly one element.
source§fn extend_reserve(&mut self, additional: usize)
fn extend_reserve(&mut self, additional: usize)
🔬This is a nightly-only experimental API. (
extend_one
)Reserves capacity in a collection for the given number of additional elements. Read more
source§impl PartialEq for Node
impl PartialEq for Node
impl Eq for Node
impl StructuralEq for Node
impl StructuralPartialEq for Node
Auto Trait Implementations§
impl RefUnwindSafe for Node
impl !Send for Node
impl !Sync for Node
impl Unpin for Node
impl UnwindSafe for Node
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.