#include <ShCtrlGraph.hpp>
Inheritance diagram for SH::ShCtrlGraphNode:
Public Types | |
typedef std::vector< ShCtrlGraphBranch > | SuccessorList |
typedef std::list< ShCtrlGraphNode * > | ShPredList |
Public Member Functions | |
std::ostream & | print (std::ostream &out, int indent) const |
Output a graph node _and its successors_ at the given indentation level. | |
std::ostream & | graphvizDump (std::ostream &out) const |
Output a graph node and its successors in graphviz format. | |
void | append (const ShPointer< ShCtrlGraphNode > &node) |
Append an unconditional successor, if node is not null. | |
void | append (const ShPointer< ShCtrlGraphNode > &node, ShVariable cond) |
Append an conditional successor, if node is not null. | |
bool | marked () const |
Whether this node has been "marked". | |
void | mark () const |
Set the marked flag. | |
void | clearMarked () const |
Clears the marked flag of this and all successors'/followers flags. | |
template<typename F> void | dfs (F &functor) |
template<typename F> void | dfs (F &functor) const |
Public Attributes | |
ShBasicBlockPtr | block |
SuccessorList | successors |
Conditional successors. | |
ShPointer< ShCtrlGraphNode > | follower |
Unconditional successor. | |
ShPredList | predecessors |
This contains of (optionally) some code, in the form of a basic block, 0 or more conditional successors (nodes which will be branched to if a particular variable is greater than 0) and one unconditional successor, which is another node that will be branched to if none of the conditional successors' conditions are true.
Only the exit node of a control graph will have an unconditional successor of 0.
Definition at line 62 of file ShCtrlGraph.hpp.
|
Output a graph node and its successors in graphviz format. See http://www.research.att.com/sw/tools/graphviz/ for more details. Definition at line 71 of file ShCtrlGraph.cpp. References follower, mark(), marked(), SH::ShPointer< ShCtrlGraphNode >::object(), and successors. |
|
Whether this node has been "marked". Useful for mark and sweep type algorithms. Definition at line 106 of file ShCtrlGraph.cpp. Referenced by clearMarked(), graphvizDump(), and print(). |