View source code
Display the source code in dmd/dfa/fast/analysis.d from which thispage was generated on github.
Report a bug
If you spot a problem with this page, click here to create aGitHub 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 usinglocal clone.

Function dmd.dfa.fast.analysis.DFAAnalyzer.convergeStatementLoopyLabels

Converges a loop or labelled block.

void convergeStatementLoopyLabels(
  dmd.dfa.fast.structure.DFAScopeRef containing,
  ref Loc loc
);

Fast-DFA Optimization: Unlike traditional "Slow DFAs" which iterate a loop until the state settles (Fixed Point Iteration), this engine visits the loop body once.

To ensure safety without iteration: 1. It checks if variables modified in the loop are used inconsistently. 2. If a variable is modified in a way that creates uncertainty (e.g., incrementing), it assumes the "Worst Case" (Unknown state) for that variable after the loop.

Authors

Richard (Rikki) Andrew Cattermole

License

Boost License 1.0