class
Ameba::AST::LivenessAnalyzer
- Ameba::AST::LivenessAnalyzer
- Reference
- Object
Overview
Performs backward dataflow liveness analysis on a scope's AST to detect dead stores (assignments whose values are never read before being overwritten or the scope ends).
The algorithm walks the AST in reverse execution order, maintaining a set of variable names that are currently "live" (will be read in the future). When an assignment is encountered and its target variable is not in the live set, the assignment is marked as a dead store.
Included Modules
Defined in:
ameba/ast/liveness_analyzer.crConstructors
Instance Method Summary
-
#analyze : Result
Performs liveness analysis in a single pass, returning both the dead stores and the entry live set.
-
#dead_stores : Array(Assignment)
Returns assignments where the value is never read before being overwritten or the scope ends.
-
#entry_live_set : LiveSet
Returns the set of variable names that are live at scope entry.
Instance methods inherited from module Ameba::AST::Dataflow
scope_body(node)
scope_body
Constructor Detail
Instance Method Detail
Performs liveness analysis in a single pass, returning both the dead stores and the entry live set.
Returns assignments where the value is never read before being overwritten or the scope ends.