class documentation

Base class for a data flow analysis.

Method __init__ Undocumented
Method aggregate_previous_after_values Computes the before value for a node from the previous after values.
Method compute_after_value Computes the after value for a node from the node and the before value.
Method visit Visit the nodes of the control flow graph, performing the analysis.
Instance Variable after_label Either the in_label or out_label depending on the direction of the analysis. Marks the after_value on a node during an analysis.
Instance Variable before_label Either the in_label or out_label depending on the direction of the analysis. Marks the before_value on a node during an analysis.
Instance Variable forward (bool) True for forward analyses, False for backward analyses.
Instance Variable in_label The name of the analysis, suffixed with _in.
Instance Variable label The name of the analysis.
Instance Variable out_label The name of the analysis, suffixed with _out.
def aggregate_previous_after_values(self, previous_after_values): (source)

Computes the before value for a node from the previous after values.

This is the 'meet' or 'join' function of the analysis. TODO(dbieber): Update terminology to match standard textbook notation.

Parameters
previous_after_valuesThe after values of all before nodes.
Returns
The before value for the current node.
def compute_after_value(self, node, before_value): (source)

Computes the after value for a node from the node and the before value.

This is the 'transfer' function of the analysis. TODO(dbieber): Update terminology to match standard textbook notation.

Parameters
nodeThe node or block for which to compute the after value.
before_valueThe before value of the node.
Returns
The computed after value for the node.
def visit(self, node): (source)

Visit the nodes of the control flow graph, performing the analysis.

Terminology:

in_value: The value of the analysis at the start of a node. out_value: The value of the analysis at the end of a node. before_value: in_value in a forward analysis; out_value in a backward

analysis.
after_value: out_value in a forward analysis; in_value in a backward
analysis.
Parameters
nodeA graph element that supports the .next / .prev API, such as a ControlFlowNode from a ControlFlowGraph or a BasicBlock from a ControlFlowGraph.
after_label = (source)

Either the in_label or out_label depending on the direction of the analysis. Marks the after_value on a node during an analysis.

before_label = (source)

Either the in_label or out_label depending on the direction of the analysis. Marks the before_value on a node during an analysis.

(bool) True for forward analyses, False for backward analyses.

in_label = (source)

The name of the analysis, suffixed with _in.

The name of the analysis.

out_label = (source)

The name of the analysis, suffixed with _out.