#include <ast.h>
Inheritance diagram for basicblockNode::
Public Methods | |
basicblockNode (decl_list *decls, stmt_list *stmts, const Coord left_coord=Coord::Unknown, const Coord right_brace=Coord::Unknown) | |
Create a new basic block. More... | |
virtual | ~basicblockNode () |
Destroy a basicblockNode. More... | |
virtual Node * | clone () const |
Clone the input node. More... | |
Accessors | |
Methods to get and set fields in the class. | |
basicblock_list & | preds () |
const basicblock_list & | preds () const |
basicblock_list & | succs () |
const basicblock_list & | succs () const |
basicblockNode * | parent () const |
void | parent (basicblockNode *par) |
basicblock_list & | children () |
const basicblock_list & | children () const |
algorithm_info * | info () const |
void | info (algorithm_info *i) |
int | dfn () const |
void | dfn (int d) |
FlowVal * | at_entry () const |
void | at_entry (FlowVal *ae) |
FlowVal * | at_exit () const |
void | at_exit (FlowVal *ae) |
AST Traversal | |
virtual void | visit (Visitor *the_visitor) |
Dispatch a Visitor. More... | |
virtual void | walk (Walker &the_walker) |
Dispatch a Walker. More... | |
virtual Node * | change (Changer &the_changer, bool redispatch=false) |
Dispatch a Changer. More... | |
Private Attributes | |
basicblock_list | _preds |
the control-flow predecessors. More... | |
basicblock_list | _succs |
the control-flow successors. More... | |
basicblockNode * | _parent |
the parent in the dominator tree. More... | |
basicblock_list | _children |
the children in the dominator tree. More... | |
algorithm_info * | _info |
algorithm info. More... | |
int | _dfn |
depth-first numbering. More... | |
FlowVal * | _at_entry |
dataflow analysis entry value. More... | |
FlowVal * | _at_exit |
dataflow analysis exit value. More... |
This subclass of blockNode represents code in basic block form to support the construction of a control-flow graph and algorithms based on that graph. Initial parsing does not produce this form. To convert the AST into a control-flow graph, first dismantle the code (using the Dismantle class) then invoke the control-flow graph algorithm (using the cfg_changer). This form also supports several other analysis algorithms, such as dominators (using the Dominators class), dominance frontiers (using the DominanceFrontiers class) and pointer analysis (using the Pointers class).
Each basicblockNode has added fields for specifying control-flow predecessors and successors, as well as fields for representing a dominator tree.
The NodeType is Block (from the superclass)
|
Create a new basic block. The basic block has the given declarations and statements (see the constructor for blockNode). By default, all the lists are empty, and the other references are null.
|
|
Destroy a basicblockNode.
|
|
|
|
|
|
Reimplemented from stmtNode. |
|
Reimplemented from stmtNode. |
|
Dispatch a Changer. This abstract method works much the walker, but allows the tree to be changed.
Reimplemented from blockNode. |
|
|
|
|
|
Clone the input node. This is not a "deep" clone, so be careful. For a deep clone, use the clone_changer class.
Reimplemented from blockNode. |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Dispatch a Visitor. This abstract method is the entry point for the visitor design pattern. Each node subclass defines a visit() method that calls the appropriate at_ method in the visitor. For more information see the Visitor documentation.
Reimplemented from blockNode. |
|
Dispatch a Walker. This abstract method works much like the visitor, but instead walks the entire underlying subtree calling the appropriate at_ method at each node. For more information see the Walker documentation.
Reimplemented from blockNode. |
|
dataflow analysis entry value. This field is used by the dataflow analysis framework to accumulate the flow-value coming into the basic block from it's predecessors. Sometimes, it's referred to as IN[B]. |
|
dataflow analysis exit value. This field is used by the dataflow analysis framework to hold the flow value exiting the basic block. It is typically computed by passing the _at_entry through the transfer functions of the statements in the block. Sometimes, it's referred to as OUT[B]. Reimplemented from stmtNode. |
|
the children in the dominator tree. This is the set of basic blocks that are immediately dominated by this one. |
|
depth-first numbering. Each basic block can be assignmed a number, usually in depth-first order. This is useful for building a bit-vector representation of sets of basic blocks. |
|
algorithm info. This field is used by various algorithms to temporarily attach some information to a basic block. |
|
the parent in the dominator tree. This is the immediate dominator of this basic block. |
|
the control-flow predecessors.
|
|
the control-flow successors.
|