Module type Fang_flow.ANALYSIS

Generic backward analysis on flow graphs.

type t

The result of analyzing a graph.

type fact

See FACT.

val run : graph -> t

The following properties must hold of the graph prior to running an analysis:

  • All labels referenced in branches must be defined
  • No labels may be defined multiple times

If they don't, the behaviour is unspecified.

Querying blocks

In the functions below, the block being queried must originate from the same graph that was analyzed. If it doesn't, the behaviour is unspecified.

val in_block : block -> t -> fact

in_block block t is the computed fact at the entry-point of block.

val out_block : block -> t -> fact

out_block block t is the computed fact leaving block (i.e., the exit-point).

val in_nodes : block -> t -> (node * fact) iter

in_nodes block t iterates over the nodes of block and the computed fact at the entry-point of each.

val out_nodes : block -> t -> (node * fact) iter

out_nodes block t iterates over the nodes of block and the computed fact at the exit-point of each.