Skip to main content

Module core

Module core 

Source
Expand description

Core dataflow analysis traits.

This module provides a unified trait for both forward and backward dataflow analysis.

§Design

The DataflowAnalyzer trait provides a layered API:

  1. Core methods (must implement): initial_info, merge
  2. Transfer granularity (choose one):
    • Block-level: override transfer_block for coarse-grained analysis
    • Statement-level: override transfer_stmt (default transfer_block iterates statements)
  3. Variable tracking (optional): transfer_edge - override if tracking per-variable state

The Runner’s (backward/forward/etc) should handle control flow mechanics automatically:

  • Goto with remapping/Match split: calls transfer_edge
  • Call transfer block for each block in need of processing

Enums§

Direction
The direction of dataflow analysis.
Edge
Represents an edge in the control flow graph.

Traits§

DataflowAnalyzer
Unified analyzer trait for dataflow analysis.

Type Aliases§

StatementLocation
Location of a lowering statement inside a block.