Skip to main content

Module dead_code

Module dead_code 

Source
Expand description

Dead-code elimination pass.

Submodules:

  • types — public config, stats, and the main DeadCodeEliminator type.
  • consts — helpers to detect constant truth/falsity.
  • fold — constant folding for Boolean connectives and if branches.
  • free_vars — free-variable analysis for let-binding elimination.
  • node_count — AST node counting plus generic unary/binary recursion helpers.
  • eliminate_flow — elimination arms for control-flow-shaped nodes.
  • eliminate_ops — elimination arms for arithmetic / comparison / modal ops.
  • eliminate_ext — elimination arms for fuzzy / set / aggregate / leaf nodes.
  • eliminate — the core recursive dispatcher that delegates to the above.

Structs§

DceConfig
Configuration controlling which DCE rules are active.
DceStats
Statistics collected during a single or multi-pass DCE run.
DeadCodeEliminator
The dead code elimination pass for TLExpr trees.