l0_check_flow.py

l0_check_flow.py

Module: l0_check_flow

Source: compiler/stage1_py/l0_check_flow.py Language: Python

Symbols

Namespace l0_check_flow

Class l0_check_flow::StatementFlow

Statement traversal and loop-liveness fixed points as one recursive algorithm.

Member Data l0_check_flow.StatementFlow.compat

1
TypeCompatibility compat

Member Data l0_check_flow.StatementFlow.expr

1
ExpressionInference expr

Member Data l0_check_flow.StatementFlow.liveness

1
ExpressionLiveness liveness

Member Data l0_check_flow.StatementFlow.lookup

1
SemanticLookup lookup

Member Data l0_check_flow.StatementFlow.patterns

1
PatternAnalysis patterns

Member Data l0_check_flow.StatementFlow.state

1
CheckerState state

Function l0_check_flow.StatementFlow._check_function

1
None l0_check_flow.StatementFlow._check_function(self, FunctionEnv func_env, FuncType func_type)

Check a single function definition.

Parameters:

  • func_env: The function’s environment containing AST and module info.
  • func_type: The function’s resolved signature.

    Function l0_check_flow.StatementFlow._check_dead_liveness_block

1
StmtFlow l0_check_flow.StatementFlow._check_dead_liveness_block(self, Block block, *bool check_return_paths)

Type-check an unreachable branch without exporting liveness or loop exits.

Function l0_check_flow.StatementFlow._check_update_from_backedge_states

1
list[list[dict[str, bool]]] l0_check_flow.StatementFlow._check_update_from_backedge_states(self, Stmt|None update, list[list[dict[str, bool]]] states)

Check a for-update statement from all reachable body backedges.

Function l0_check_flow.StatementFlow._check_loop_iteration

1
tuple[LoopFlowCapture, list[list[dict[str, bool]]], StmtFlow] l0_check_flow.StatementFlow._check_loop_iteration(self, Block body, *Stmt|None update=None, bool check_return_paths=False)

Check one loop iteration and return captured flow states.

Function l0_check_flow.StatementFlow._loop_liveness_fixed_point

1
tuple[list[dict[str, bool]], LoopFlowCapture, list[list[dict[str, bool]]]] l0_check_flow.StatementFlow._loop_liveness_fixed_point(self, list[dict[str, bool]] pre_loop, Block body, *Expr|None cond=None, Stmt|None update=None)

Converge loop-head liveness and diagnose later-iteration uses.

Function l0_check_flow.StatementFlow._check_block

1
StmtFlow l0_check_flow.StatementFlow._check_block(self, Block block, *bool check_return_paths=False, bool push_new_scope=True)

Check a block of statements.

Parameters:

  • block: The Block node.
  • check_return_paths: Whether to track return paths in this block.
  • push_new_scope: Whether to push a new lexical scope for this block.

    Function l0_check_flow.StatementFlow._check_stmt

1
StmtFlow l0_check_flow.StatementFlow._check_stmt(self, Stmt stmt, *bool check_return_paths=False)

Check a single statement.

Parameters:

  • stmt: The Stmt node.
  • check_return_paths: Whether to update return path tracking.

    Function l0_check_flow.StatementFlow._check_return

1
None l0_check_flow.StatementFlow._check_return(self, ReturnStmt stmt)

Check return statement validity and type compatibility.