pub enum Statement {
Show 15 variants
LocalDecl {
name: String,
name_span: SourceSpan,
display_name: String,
size_bytes: usize,
span: SourceSpan,
},
Assign {
name: String,
name_span: SourceSpan,
expr: ExprNode,
decl_struct_ptr: Option<String>,
span: SourceSpan,
},
Expr(ExprNode),
LabelDecl {
label: Label,
span: SourceSpan,
},
Branch {
target: Label,
args: BlockArgs,
span: SourceSpan,
},
BranchInd {
ptr: TypedAtom,
targets: Vec<Label>,
span: SourceSpan,
},
Switch {
scrutinee: TypedAtom,
cases: Vec<SwitchCase>,
default: Option<(Label, BlockArgs)>,
span: SourceSpan,
},
CBranch {
condition: TypedAtom,
target: Label,
target_args: BlockArgs,
fallthrough: Label,
fallthrough_args: BlockArgs,
span: SourceSpan,
},
Call {
target: Callee,
tail: bool,
args: BlockArgs,
targets: Vec<Label>,
span: SourceSpan,
},
CallInd {
ptr: TypedAtom,
args: Vec<TypedAtom>,
targets: Vec<Label>,
span: SourceSpan,
},
Return {
ptr: TypedAtom,
value: Option<TypedAtom>,
span: SourceSpan,
},
ReturnValue {
value: TypedAtom,
span: SourceSpan,
},
BadInsn {
span: SourceSpan,
},
Assert {
condition: TypedAtom,
span: SourceSpan,
},
Commented {
comment: String,
inner: Box<Statement>,
},
}Variants§
LocalDecl
Assign
Fields
name_span: SourceSpandecl_struct_ptr: Option<String>A Foo* struct-pointer type declared on the assignment, if any. When
present, the result value is retyped to that struct pointer (used to
seed struct typing in tests). A plain iN/fN declared type is not
recorded here — it only drives size coercion of the rhs.
span: SourceSpanExpr(ExprNode)
LabelDecl
Branch
Fields
args: BlockArgsPer-parameter arguments: (param_name, value) in declaration order.
Non-empty when the branch was written as goto <block @v1=e1 @v2=e2>.
span: SourceSpanBranchInd
Fields
targets: Vec<Label>Resolved jump targets, from a // -> <a>, <b> edge hint. The indirect
jump’s own syntax encodes no successors, so without this the block has
no out-edges.
span: SourceSpanSwitch
Multi-way dispatch: switch %idx { 0x0 => <a>, default => <d> }.
Fields
cases: Vec<SwitchCase>(case value, target, per-parameter arguments) in written order.
span: SourceSpanCBranch
Fields
span: SourceSpanCall
Fields
args: BlockArgsArguments passed to the callee, one per inferred callee input, in
order. The name in each pair is the callee’s parameter name as
printed (@r0, @arg1, …); it is decorative and discarded on
lowering, where only the positional atoms matter.
targets: Vec<Label>The call’s return (fall-through) block(s), from a // -> <ret> edge
hint. A call terminates its block; this records where control resumes
after the callee returns. Empty for a non-returning call.
span: SourceSpanCallInd
Fields
targets: Vec<Label>The call’s return (fall-through) block(s), from a // -> <ret> edge
hint. See Statement::Call.
span: SourceSpanReturn
ReturnValue
BadInsn
Bytes that did not decode to a valid instruction; a terminator with no successors and no operands.
Fields
span: SourceSpanAssert
Commented
A comment attached to this statement, written as # text on the preceding line.