#include <ICFGDFSolver.hpp>


Public Types | |
| enum | DFDirectionType { Forward, Backward } |
Public Member Functions | |
| ICFGDFSolver (DFDirectionType pDirection, ICFGDFProblem &prob) | |
| virtual | ~ICFGDFSolver () |
| void | solve (OA_ptr< ICFG::ICFGInterface > icfg, DFPImplement algorithm) |
| int | getNumIter () |
| void | dump (std::ostream &os, OA_ptr< IRHandlesIRInterface > ir) |
Protected Attributes | |
| std::map< OA_ptr < ICFG::NodeInterface > , OA_ptr< DataFlowSet > > | mNodeInSetMap |
| std::map< OA_ptr < ICFG::NodeInterface > , OA_ptr< DataFlowSet > > | mNodeOutSetMap |
| std::map< OA_ptr < ICFG::NodeInterface >, bool > | mNodeInitTransApp |
| ICFGDFProblem & | mDFProb |
Private Member Functions | |
| void | initialize (OA_ptr< DGraph::DGraphInterface > dg) |
| bool | atDGraphNode (OA_ptr< DGraph::NodeInterface > node, DGraph::DGraphEdgeDirection pOrient) |
| void | finalizeNode (OA_ptr< DGraph::NodeInterface > node) |
| OA_ptr< DataFlowSet > | transfer (OA_ptr< DataFlowSet > in, OA_ptr< DGraph::NodeInterface > n) |
Private Attributes | |
| OA_ptr< DataFlowSet > | mTop |
| DFDirectionType | mDirection |
Definition at line 39 of file ICFGDFSolver.hpp.
Definition at line 41 of file ICFGDFSolver.hpp.
| OA::DataFlow::ICFGDFSolver::ICFGDFSolver | ( | DFDirectionType | pDirection, | |
| ICFGDFProblem & | prob | |||
| ) |
Definition at line 20 of file ICFGDFSolver.cpp.
References OA::DataFlow::debug, and OA_DEBUG_CTRL_MACRO.
| virtual OA::DataFlow::ICFGDFSolver::~ICFGDFSolver | ( | ) | [inline, virtual] |
Definition at line 53 of file ICFGDFSolver.hpp.
| bool OA::DataFlow::ICFGDFSolver::atDGraphNode | ( | OA_ptr< DGraph::NodeInterface > | node, | |
| DGraph::DGraphEdgeDirection | pOrient | |||
| ) | [private, virtual] |
Reimplemented from OA::DataFlow::DGraphSolverDFP.
Definition at line 120 of file ICFGDFSolver.cpp.
References OA::ICFG::CALL_EDGE, OA::ICFG::CALL_RETURN_EDGE, OA::DataFlow::ICFGDFProblem::calleeToCaller(), OA::DataFlow::ICFGDFProblem::callerToCallee(), OA::DataFlow::ICFGDFProblem::callToReturn(), OA::ICFG::CFLOW_EDGE, OA::OA_ptr< T >::convert(), OA::DataFlow::debug, OA::DGraph::DEdgeOrg, OA::DataFlow::ICFGDFProblem::entryTransfer(), OA::DataFlow::ICFGDFProblem::exitTransfer(), OA::IRHandle::hval(), mDFProb, OA::DataFlow::ICFGDFProblem::meet(), mNodeInitTransApp, mNodeInSetMap, mNodeOutSetMap, mTop, OA::ICFG::RETURN_EDGE, and OA::DataFlow::ICFGDFProblem::transfer().

| void OA::DataFlow::ICFGDFSolver::dump | ( | std::ostream & | os, | |
| OA_ptr< IRHandlesIRInterface > | ir | |||
| ) |
Definition at line 331 of file ICFGDFSolver.cpp.
References OA::OA_ptr< T >::dump(), mNodeInSetMap, and mNodeOutSetMap.

| void OA::DataFlow::ICFGDFSolver::finalizeNode | ( | OA_ptr< DGraph::NodeInterface > | node | ) | [private, virtual] |
Reimplemented from OA::DataFlow::DGraphSolverDFP.
Definition at line 322 of file ICFGDFSolver.cpp.
| int OA::DataFlow::ICFGDFSolver::getNumIter | ( | ) | [inline] |
Definition at line 62 of file ICFGDFSolver.hpp.
References OA::DataFlow::DGraphSolverDFP::afterSolve_getNumIter().

| void OA::DataFlow::ICFGDFSolver::initialize | ( | OA_ptr< DGraph::DGraphInterface > | dg | ) | [private, virtual] |
commented by PLM 08/10/06 void ICFGDFSolver::initialize(OA_ptr<DGraph::DGraphInterface> dg) { OA_ptr<ICFG::ICFG> cfg = dg.convert<ICFG::ICFG>();
iterate over all nodes and call initialization routine that sets up DataFlowSets OA_ptr<ICFG::ICFG::NodesIterator> nodeIterPtr; nodeIterPtr = cfg->getNodesIterator(); if (debug) { std::cout << "initializing: looping over nodes:\n"; } for ( ;nodeIterPtr->isValid(); ++(*nodeIterPtr) ) { if (debug) { std::cout << "\tNode " << (nodeIterPtr->current())->getId() << std::endl; } mNodeInSetMap[nodeIterPtr->current()] = mDFProb.initializeNodeIN(nodeIterPtr->current()); mNodeOutSetMap[nodeIterPtr->current()] = mDFProb.initializeNodeOUT(nodeIterPtr->current()); mNodeInitTransApp[nodeIterPtr->current()] = false; } }
Implements OA::DataFlow::DGraphSolverDFP.
Definition at line 91 of file ICFGDFSolver.cpp.
| void OA::DataFlow::ICFGDFSolver::solve | ( | OA_ptr< ICFG::ICFGInterface > | icfg, | |
| DFPImplement | algorithm | |||
| ) |
solves data-flow problem, after done in and out nodes will have correct data-flow values
Definition at line 27 of file ICFGDFSolver.cpp.
| OA_ptr<DataFlowSet> OA::DataFlow::ICFGDFSolver::transfer | ( | OA_ptr< DataFlowSet > | in, | |
| OA_ptr< DGraph::NodeInterface > | n | |||
| ) | [private] |
transfer function for a CFG::Interface::Node Will clone in set to block before passing it to this function so ok to return a modified in set
ICFGDFProblem& OA::DataFlow::ICFGDFSolver::mDFProb [protected] |
Definition at line 113 of file ICFGDFSolver.hpp.
Referenced by atDGraphNode().
Definition at line 46 of file ICFGDFSolver.hpp.
std::map<OA_ptr<ICFG::NodeInterface>,bool> OA::DataFlow::ICFGDFSolver::mNodeInitTransApp [protected] |
Definition at line 111 of file ICFGDFSolver.hpp.
Referenced by atDGraphNode().
std::map<OA_ptr<ICFG::NodeInterface>, OA_ptr<DataFlowSet> > OA::DataFlow::ICFGDFSolver::mNodeInSetMap [protected] |
Definition at line 105 of file ICFGDFSolver.hpp.
Referenced by atDGraphNode(), and dump().
std::map<OA_ptr<ICFG::NodeInterface>, OA_ptr<DataFlowSet> > OA::DataFlow::ICFGDFSolver::mNodeOutSetMap [protected] |
Definition at line 107 of file ICFGDFSolver.hpp.
Referenced by atDGraphNode(), and dump().
OA_ptr<DataFlowSet> OA::DataFlow::ICFGDFSolver::mTop [private] |
Definition at line 44 of file ICFGDFSolver.hpp.
Referenced by atDGraphNode().
1.7.1