class documentation

class ControlFlowNode(object): (source)

View In Hierarchy

A node in a control flow graph.

Corresponds to a single Instruction contained in a single BasicBlock.

Method __init__ Undocumented
Method get_branches Returns the branch options available at the end of this node.
Method get_label Gets the value of a label on the Instruction.
Method has_label Returns whether this Instruction has the specified label.
Method set_label Sets the value of a label on the Instruction.
Instance Variable block The BasicBlock in which this node's instruction resides.
Instance Variable graph The ControlFlowGraph which this node is a part of.
Instance Variable instruction The Instruction corresponding to this node.
Instance Variable labels Metadata attached to this node, for example for use by data flow analyses.
Instance Variable uuid A unique identifier for the ControlFlowNode.
Property branches Returns the branch options available at the end of this node.
Property next Returns the set of possible next instructions.
Property next_from_end Returns the set of possible next instructions.
Property prev Returns the set of possible previous instructions.
def __init__(self, graph, block, instruction): (source)

Undocumented

def get_branches(self, include_except_branches=False, include_reraise_branches=False): (source)

Returns the branch options available at the end of this node.

Returns
A dictionary with possible keys True and False, and values given by the node that is reached by taking the True/False branch. An empty dictionary indicates that there are no branches to take, and so self.next gives the next node (in a set of size 1). A value of '<exit>' or '<raise>' indicates that taking that branch leads to the exit or raise block, since there are no exit ControlFlowNodes in a ControlFlowGraph.
def get_label(self, label): (source)

Gets the value of a label on the Instruction.

def has_label(self, label): (source)

Returns whether this Instruction has the specified label.

def set_label(self, label, value): (source)

Sets the value of a label on the Instruction.

The BasicBlock in which this node's instruction resides.

The ControlFlowGraph which this node is a part of.

instruction = (source)

The Instruction corresponding to this node.

Metadata attached to this node, for example for use by data flow analyses.

A unique identifier for the ControlFlowNode.

Returns the branch options available at the end of this node.

Returns
A dictionary with possible keys True and False, and values given by the node that is reached by taking the True/False branch. An empty dictionary indicates that there are no branches to take, and so self.next gives the next node (in a set of size 1). A value of None indicates that taking that branch leads to the exit, since there are no exit ControlFlowNodes in a ControlFlowGraph.

Returns the set of possible next instructions.

This allows for taking exits from the middle (exceptions).

@property
next_from_end = (source)

Returns the set of possible next instructions.

This does not allow for taking exits from the middle (exceptions).

Returns the set of possible previous instructions.