Report a bug
If you spot a problem with this page, click here to create a Bugzilla issue.
Improve this page
Quickly fork, edit online, and submit a pull request for this page.
Requires a signed-in GitHub account. This works well for small changes.
If you'd like to make larger changes you may want to consider using
a local clone.
dmd.dfa.fast.statement
Statement walker for the fast Data Flow Analysis engine.
This module implements the AST visitor that handles Control Flow.
It is responsible for:
- Managing Scopes: Pushing and popping DFAScope as it enters/leaves blocks.
- Handling Branching: Splitting execution for if and switch statements.
- Handling Loops: Managing state for for, while, and do loops.
- Handling Jumps: Resolving break, continue, goto, and return.
Authors:
License:
Source dfa/fast/statement.d
Documentation https://dlang.org/phobos/dmd_dfa_fast_statement.html
- class
StatementWalker: dmd.visitor.SemanticTimeTransitiveVisitor; - Visits Statement nodes to drive the Data Flow Analysis.This class navigates the structure of the function. When it encounters control flow (like an if statement), it acts as a traffic director:
- It creates a new Scope for the "True" branch.
- It analyzes that branch.
- It creates a new Scope for the "False" branch.
- It analyzes that branch.
- It calls analyzer.converge... to merge the results back together.
- final void
isBranchTakenIf(ref DFALatticeReftrueLR, ref DFALatticeReffalseLR, IfStatementifs, out boolforTrue, out boolforFalse); - Check if a if statement will be branched into by a goto or by the condition
- final bool
isBranchTaken(ref DFALatticeRefcondition, Statementstmt); - Check if a statement will be branched into either by a goto or by the condition.
- final bool
isBranchTaken(Statementstmt); - Check if a statement will be branched into either by a goto.
Copyright © 1999-2026 by the D Language Foundation | Page generated by
Ddoc on Wed Aug 5 15:41:18 2026