pub struct CfgNode {
pub expr: Ir,
pub next: Option<Index>,
pub span: Span,
pub allow_unreachable: bool,
pub errors: HashSet<CompileError>,
}Expand description
A single entry for a node in the CFG.
Fields§
§expr: IrThe variant of this node.
next: Option<Index>The continuation of the node, if present. Absence of a continuation indicates the Done or
“halting” continuation.
span: SpanThe associated syntactic span of this node. If an error is emitted regarding this node, this span may be used to correctly map it to a location in the surface syntax.
allow_unreachable: bool“Machine-generated” nodes are allowed to be unreachable. This is used when automatically inserting continues when resolving scopes, so that if a continue is inserted which isn’t actually reachable, an error isn’t emitted.
errors: HashSet<CompileError>Nodes keep a hashset of errors in order to deduplicate any errors which are emitted multiple
times for the same node. Errors are traversed when code is emitted during
Cfg::generate_target.