pub enum Operation<'a> {
Show 18 variants
Invalid,
Dfg,
Cfg,
Block,
DefineFunc {
decl: &'a FuncDecl<'a>,
},
DeclareFunc {
decl: &'a FuncDecl<'a>,
},
CallFunc {
func: TermId,
},
LoadFunc {
func: TermId,
},
Custom {
operation: NodeId,
},
CustomFull {
operation: NodeId,
},
DefineAlias {
decl: &'a AliasDecl<'a>,
value: TermId,
},
DeclareAlias {
decl: &'a AliasDecl<'a>,
},
TailLoop,
Conditional,
Tag {
tag: u16,
},
DeclareConstructor {
decl: &'a ConstructorDecl<'a>,
},
DeclareOperation {
decl: &'a OperationDecl<'a>,
},
Import {
name: &'a str,
},
}Expand description
Operations that nodes can perform.
Variants§
Invalid
Invalid operation to be used as a placeholder. This is useful for modules that have non-contiguous node ids, or modules that have not yet been fully constructed.
Dfg
Data flow graphs.
Cfg
Control flow graphs.
Block
Basic blocks.
DefineFunc
Function definitions.
DeclareFunc
Function declarations.
CallFunc
Function calls.
LoadFunc
Function constants.
Custom
Custom operation.
The node’s parameters correspond to the explicit parameter of the custom operation,
leaving out the implicit parameters. Once the declaration of the custom operation
becomes known by resolving the reference, the node can be transformed into a Operation::CustomFull
by inferring terms for the implicit parameters or at least filling them in with a wildcard term.
CustomFull
Custom operation with full parameters.
The node’s parameters correspond to both the explicit and implicit parameters of the custom operation.
Since this can be tedious to write, the Operation::Custom variant can be used to indicate that
the implicit parameters should be inferred.
DefineAlias
Alias definitions.
Fields
DeclareAlias
Alias declarations.
TailLoop
Tail controlled loop. Nodes with this operation contain a dataflow graph that is executed in a loop. The loop body is executed at least once, producing a result that indicates whether to continue the loop or return the result.
§Port Types
- Inputs:
inputs+rest - Outputs:
outputs+rest - Sources:
inputs+rest - Targets:
(adt [inputs outputs])+rest
Conditional
Tag
Create an ADT value from a sequence of inputs.
DeclareConstructor
Declaration for a term constructor.
Nodes with this operation must be within a module region.
Fields
decl: &'a ConstructorDecl<'a>The declaration of the constructor.
DeclareOperation
Declaration for a operation.
Nodes with this operation must be within a module region.
Fields
decl: &'a OperationDecl<'a>The declaration of the operation.
Import
Import a symbol.
Implementations§
Trait Implementations§
impl<'a> Eq for Operation<'a>
impl<'a> StructuralPartialEq for Operation<'a>
Auto Trait Implementations§
impl<'a> Freeze for Operation<'a>
impl<'a> RefUnwindSafe for Operation<'a>
impl<'a> Send for Operation<'a>
impl<'a> Sync for Operation<'a>
impl<'a> Unpin for Operation<'a>
impl<'a> UnwindSafe for Operation<'a>
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.