OA::CFG::Node Class Reference

#include <CFG.hpp>

Inheritance diagram for OA::CFG::Node:

Inheritance graph
[legend]
Collaboration diagram for OA::CFG::Node:

Collaboration graph
[legend]

List of all members.

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< EdgesIteratorInterfacegetCFGIncomingEdgesIterator () const
 DGraph Iterators.
OA_ptr< EdgesIteratorInterfacegetCFGOutgoingEdgesIterator () const
 CFG Specific Iterators.
OA_ptr< NodesIteratorInterfacegetCFGSourceNodesIterator () const
OA_ptr< NodesIteratorInterfacegetCFGPredNodesIterator () const
OA_ptr< NodesIteratorInterfacegetCFGSinkNodesIterator () const
OA_ptr< NodesIteratorInterfacegetCFGSuccNodesIterator () 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


Detailed Description

CFG::Node implements the CFG::NodeInterface

Definition at line 87 of file CFG.hpp.


Constructor & Destructor Documentation

OA::CFG::Node::Node (  ) 

Definition at line 271 of file CFG.cpp.

References Ctor().

Here is the call graph for this function:

OA::CFG::Node::Node ( StmtHandle  n  ) 

Definition at line 273 of file CFG.cpp.

References Ctor(), and mStmt_list.

Here is the call graph for this function:

OA::CFG::Node::~Node (  ) 

Definition at line 70 of file CFG.cpp.

References mStmt_list.


Member Function Documentation

void OA::CFG::Node::add ( StmtHandle  h  ) 

add statement to block

Definition at line 137 of file CFG.cpp.

References mStmt_list.

void OA::CFG::Node::add_front ( StmtHandle  h  ) 

Definition at line 142 of file CFG.cpp.

References mStmt_list.

void OA::CFG::Node::Ctor (  )  [private]

Definition at line 288 of file CFG.cpp.

References mStmt_list.

Referenced by Node().

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

remove all statements from block

Definition at line 165 of file CFG.cpp.

References mStmt_list.

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().

Here is the call graph for this function:

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().

Here is the call graph for this function:

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().

Here is the call graph for this function:

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().

Here is the call graph for this function:

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().

Here is the call graph for this function:

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().

Here is the call graph for this function:

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().

Here is the call graph for this function:

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.


Friends And Related Function Documentation

friend class CFG [friend]

Definition at line 175 of file CFG.hpp.

friend class NodeStatementsIterator [friend]

Definition at line 176 of file CFG.hpp.

Referenced by getNodeStatementsIterator().

friend class NodeStatementsRevIterator [friend]

Definition at line 177 of file CFG.hpp.

Referenced by getNodeStatementsRevIterator().


Member Data Documentation

Definition at line 249 of file CFG.hpp.


The documentation for this class was generated from the following files:

Generated on Fri Jul 24 05:39:30 2009 for OpenADFortTk (extended to Open64) by  doxygen 1.5.7.1