#include <CFG.hpp>


Public Member Functions | |
| Node () | |
| Node (StmtHandle n) | |
| ~Node () | |
| unsigned int | size () const |
| An id unique within instances of CFG::Node is taken. | |
| bool | empty () const |
| remove all statements from block | |
| void | add (StmtHandle h) |
| add statement to block | |
| void | add_front (StmtHandle h) |
| StmtHandle | erase (StmtHandle h) |
| erase statement from block, Careful: linear time! | |
| void | split (StmtHandle splitPoint, OA_ptr< Node > newBlock) |
| Transfer all statements beginning at (and including) splitPoint to the new basic block, 'newBlock'. | |
| void | dump (std::ostream &os) |
| void | dump (std::ostream &os, OA_ptr< IRHandlesIRInterface > ir) |
| void | dumpdot (CFG &currcfg, std::ostream &os, OA_ptr< IRHandlesIRInterface > ir) |
| virtual void | output (OA::IRHandlesIRInterface &ir) |
| OA_ptr < NodeStatementsIteratorInterface > | getNodeStatementsIterator () const |
| create a forward order iterator for the statements in the node | |
| OA_ptr < NodeStatementsRevIteratorInterface > | getNodeStatementsRevIterator () const |
| create a reverse order iterator for the statements in the node | |
| OA_ptr< EdgesIteratorInterface > | getCFGIncomingEdgesIterator () const |
| DGraph Iterators. | |
| OA_ptr< EdgesIteratorInterface > | getCFGOutgoingEdgesIterator () const |
| CFG Specific Iterators. | |
| OA_ptr< NodesIteratorInterface > | getCFGSourceNodesIterator () const |
| OA_ptr< NodesIteratorInterface > | getCFGPredNodesIterator () const |
| OA_ptr< NodesIteratorInterface > | getCFGSinkNodesIterator () const |
| OA_ptr< NodesIteratorInterface > | getCFGSuccNodesIterator () const |
Protected Member Functions | |
| std::list< StmtHandle >::iterator | getStmtListBegin () |
| gives inheriters read access to mStmt_list (a) | |
| std::list< StmtHandle >::iterator | getStmtListEnd () |
| gives inheriters read access to mStmt_list (b) | |
| std::list< StmtHandle > ::reverse_iterator | getStmtListRBegin () |
| gives inheriters read access to mStmt_list (c) | |
| std::list< StmtHandle > ::reverse_iterator | getStmtListREnd () |
| gives inheriters read access to mStmt_list (d) | |
Private Member Functions | |
| void | Ctor () |
Private Attributes | |
| OA_ptr< std::list< StmtHandle > > | mStmt_list |
| ExprHandle | mEnd |
Friends | |
| class | CFG |
| class | NodeStatementsIterator |
| class | NodeStatementsRevIterator |
Definition at line 87 of file CFG.hpp.
| OA::CFG::Node::Node | ( | ) |
| OA::CFG::Node::Node | ( | StmtHandle | n | ) |
Definition at line 273 of file CFG.cpp.
References Ctor(), and mStmt_list.

| OA::CFG::Node::~Node | ( | ) |
| void OA::CFG::Node::add | ( | StmtHandle | h | ) |
| void OA::CFG::Node::add_front | ( | StmtHandle | h | ) |
| void OA::CFG::Node::Ctor | ( | ) | [private] |
| void OA::CFG::Node::dump | ( | std::ostream & | os, | |
| OA_ptr< IRHandlesIRInterface > | ir | |||
| ) |
| void OA::CFG::Node::dump | ( | std::ostream & | os | ) | [virtual] |
Reimplemented from OA::DGraph::NodeImplement.
Definition at line 277 of file CFG.cpp.
Referenced by OA::SSA::Phi::dump().
| void OA::CFG::Node::dumpdot | ( | CFG & | currcfg, | |
| std::ostream & | os, | |||
| OA_ptr< IRHandlesIRInterface > | ir | |||
| ) |
commented out by PLM 08/17/06 void longdump(CFG::CFG&, std::ostream& os, OA_ptr<IRHandlesIRInterface> ir);
| bool OA::CFG::Node::empty | ( | ) | const |
| StmtHandle OA::CFG::Node::erase | ( | StmtHandle | h | ) |
erase statement from block, Careful: linear time!
Remove 'h' from the statement list; return the removed handle or 0 if not found.
Definition at line 151 of file CFG.cpp.
References mStmt_list.
| OA_ptr< EdgesIteratorInterface > OA::CFG::Node::getCFGIncomingEdgesIterator | ( | ) | const [virtual] |
DGraph Iterators.
Implements OA::CFG::NodeInterface.
Definition at line 221 of file CFG.cpp.
References OA::DGraph::NodeImplement::getIncomingEdgesIterator().

| OA_ptr< EdgesIteratorInterface > OA::CFG::Node::getCFGOutgoingEdgesIterator | ( | ) | const [virtual] |
CFG Specific Iterators.
Implements OA::CFG::NodeInterface.
Definition at line 229 of file CFG.cpp.
References OA::DGraph::NodeImplement::getOutgoingEdgesIterator().

| OA_ptr< NodesIteratorInterface > OA::CFG::Node::getCFGPredNodesIterator | ( | ) | const [virtual] |
Implements OA::CFG::NodeInterface.
Definition at line 254 of file CFG.cpp.
References OA::DGraph::NodeImplement::getSourceNodesIterator().

| OA_ptr< NodesIteratorInterface > OA::CFG::Node::getCFGSinkNodesIterator | ( | ) | const [virtual] |
Implements OA::CFG::NodeInterface.
Definition at line 245 of file CFG.cpp.
References OA::DGraph::NodeImplement::getSinkNodesIterator().

| OA_ptr< NodesIteratorInterface > OA::CFG::Node::getCFGSourceNodesIterator | ( | ) | const [virtual] |
Implements OA::CFG::NodeInterface.
Definition at line 237 of file CFG.cpp.
References OA::DGraph::NodeImplement::getSourceNodesIterator().

| OA_ptr< NodesIteratorInterface > OA::CFG::Node::getCFGSuccNodesIterator | ( | ) | const [virtual] |
Implements OA::CFG::NodeInterface.
Definition at line 262 of file CFG.cpp.
References OA::DGraph::NodeImplement::getSinkNodesIterator().

| OA_ptr< NodeStatementsIteratorInterface > OA::CFG::Node::getNodeStatementsIterator | ( | ) | const [virtual] |
create a forward order iterator for the statements in the node
Implements OA::CFG::NodeInterface.
Definition at line 172 of file CFG.cpp.
References NodeStatementsIterator.
| OA_ptr< NodeStatementsRevIteratorInterface > OA::CFG::Node::getNodeStatementsRevIterator | ( | ) | const [virtual] |
create a reverse order iterator for the statements in the node
Implements OA::CFG::NodeInterface.
Definition at line 182 of file CFG.cpp.
References NodeStatementsRevIterator.
| std::list< StmtHandle >::iterator OA::CFG::Node::getStmtListBegin | ( | ) | [protected] |
gives inheriters read access to mStmt_list (a)
Definition at line 295 of file CFG.cpp.
References mStmt_list.
| std::list< StmtHandle >::iterator OA::CFG::Node::getStmtListEnd | ( | ) | [protected] |
gives inheriters read access to mStmt_list (b)
Definition at line 300 of file CFG.cpp.
References mStmt_list.
| std::list< StmtHandle >::reverse_iterator OA::CFG::Node::getStmtListRBegin | ( | ) | [protected] |
gives inheriters read access to mStmt_list (c)
Definition at line 305 of file CFG.cpp.
References mStmt_list.
| std::list< StmtHandle >::reverse_iterator OA::CFG::Node::getStmtListREnd | ( | ) | [protected] |
gives inheriters read access to mStmt_list (d)
Definition at line 310 of file CFG.cpp.
References mStmt_list.
| void OA::CFG::Node::output | ( | OA::IRHandlesIRInterface & | ir | ) | [virtual] |
commented out by PLM 08/17/06 print the node ID os << "CFG Node: " << getId(); if (num_incoming() == 0) os << " (root)"; if (currcfg.getEntry().ptrEqual(this)) { os << " [ENTRY]"; } else if (currcfg.getExit().ptrEqual(this)) { os << " [EXIT]"; } os << endl;
print the node contents CFG::NodeStatementsIterator stmtIt(*this); for ( ; stmtIt.isValid(); ++stmtIt) { os << " "; StmtHandle s = stmtIt.current(); rir->dump(s, os); os << endl; }
print the sources(s) OA_ptr<DGraph::EdgesIteratorInterface> in_iter = getIncomingEdgesIterator(); if (in_iter->isValid()) { OA_ptr<Edge> e = in_iter->current(); os << " <-- (" << (e->source())->getId(); os << " ["; e->dump(os); os << "]"; ++(*in_iter); for ( ; in_iter->isValid(); ++(*in_iter)) { e = in_iter->current(); os << ", " << (e->source())->getId(); os << " ["; e->dump(os); os << "]"; } os << ")" << endl; }
print the sink(s) OA_ptr<DGraph::EdgesIterator> out_iter = getOutgoingEdgesIterator(); if (out_iter->isValid()) { OA_ptr<Edge> e = out_iter->current(); os << " --> (" << (e->sink())->getId(); os << " ["; e->dump(os); os << "]"; ++(*out_iter); for ( ; out_iter->isValid(); ++(*out_iter)) { e = out_iter->current(); os << ", " << (e->sink())->getId(); os << " ["; e->dump(os); os << "]"; } os << ")" << endl; }
commented out by PLM 08/17/06 const char* nm = ir.GetSymNameFromSymHandle(name); os << "digraph OA_CFG_" << ir->toString(mName) << " {" << endl; os << "node [shape=rectangle];" << endl;
print the contents of all the nodes (including edges) OA_ptr<NodesIterator> nodesIterPtr = getNodesIterator(); for ( ; nodesIterPtr->isValid(); ++(*nodesIterPtr) ) { nodesIterPtr->current()->dumpdot(*this,os,ir); }
print all edges OA_ptr<EdgesIterator> edgesIterPtr = getEdgesIterator(); for ( ; edgesIterPtr->isValid(); ++(*edgesIterPtr) ) { edgesIterPtr->current()->dumpdot(os,ir); }
os << "}" << endl; os.flush();
commented out by PLM 08/17/06 print the node os << getId() << " [ label=\"====== CFG node " << getId() << " ======";
if (currcfg.getEntry().ptrEqual(this)) { os << " (entry)"; } else if (currcfg.getExit().ptrEqual(this)) { os << " (exit)"; } os << "\\n"; print the node contents CFG::NodeStatementsIterator stmtIt(*this); for ( ; stmtIt.isValid(); ++stmtIt) { StmtHandle s = stmtIt.current(); os << std::endl << ir->toString(s) << "\\n"; } os << "\" ];" << endl; os.flush();
Reimplemented from OA::DGraph::NodeImplement.
Definition at line 1099 of file CFG.cpp.
References OA::CFG::NodeStatementsIterator::current(), OA::DGraph::NodeImplement::getId(), OA::CFG::NodeStatementsIterator::isValid(), OA::Annotation::sOutBuild, and OA::IRHandlesIRInterface::toString().

| unsigned int OA::CFG::Node::size | ( | ) | const [virtual] |
An id unique within instances of CFG::Node is taken.
return number of statements in block
Implements OA::CFG::NodeInterface.
Definition at line 132 of file CFG.cpp.
References mStmt_list.
| void OA::CFG::Node::split | ( | OA::StmtHandle | splitPoint, | |
| OA_ptr< Node > | newBlock | |||
| ) |
Transfer all statements beginning at (and including) splitPoint to the new basic block, 'newBlock'.
Definition at line 797 of file CFG.cpp.
References mStmt_list.
friend class NodeStatementsIterator [friend] |
friend class NodeStatementsRevIterator [friend] |
ExprHandle OA::CFG::Node::mEnd [private] |
OA_ptr<std::list<StmtHandle> > OA::CFG::Node::mStmt_list [private] |
Definition at line 246 of file CFG.hpp.
Referenced by add(), add_front(), Ctor(), empty(), erase(), getStmtListBegin(), getStmtListEnd(), getStmtListRBegin(), getStmtListREnd(), Node(), OA::CFG::NodeStatementsIterator::NodeStatementsIterator(), OA::CFG::NodeStatementsRevIterator::NodeStatementsRevIterator(), size(), split(), and ~Node().
1.5.7.1