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.utils
Utilities for Data Flow Analysis.
Authors:
License:
Source dfa/utils.d
Documentation https://dlang.org/phobos/dmd_dfa_utils.html
- bool
isTypeNullable(Typetype); - Checks if a type is capable of being null at runtime.The DFA uses this to determine if a null-check is required for a specific variable.Returns:true if the type is a pointer, array, class, delegate, etc.
- bool
isTypeTruthy(Typetype); - Checks if a type can be evaluated as a boolean (truthy/falsey).Used by the DFA to determine if control flow (like if statements) depends on this variable.Returns:false for types like void (noreturn) or struct (unless they define opCast), true for integers, pointers, bools, etc.
- EqualityArgType
equalityArgTypes(Typelhs, Typerhs); - Classifies how two types are compared for equality at runtime.This mirrors the logic in the compiler backend/glue layer. The DFA needs this to accurately predict if an equality check (==) involves simple integer comparison, array comparison, or struct comparison.See Also:EqualityArgType
Copyright © 1999-2026 by the D Language Foundation | Page generated by
Ddoc on Wed Aug 5 15:41:15 2026