ROSE
0.9.6a
|
TemplatedDominatorTree constructs a dominator/postdominator tree for a cfg. For the template parameter any cfg following Jeremias interface may be used. More...
#include <DominatorTree.h>
Public Member Functions | |
void | writeDot (char *filename) |
writes the DT in DOT-notation to the file given in filename More... | |
TemplatedDominatorTree (SgNode *head, Direction d=DominatorForwardBackwardWrapperClass< CFGFilterFunction >::PRE_DOMINATOR) | |
constructor for the DT. Head is the start point for the DT construction. DT works for SgFunctionDefintion nodes, unexpected behaviour for non-SgFunctionDefinition!!! More... | |
int | getSize () |
std::set< int > | getDirectDominatedSet (int nodeID) |
returns the set of nodes directly dominated by nodeID More... | |
int | getImDomID (int i) |
int | getImDomID (VirtualCFG::FilteredCFGNode< CFGFilterFunction > node) |
get the ImDomID for given SgNode, returns negative for non-cfg-node More... | |
bool | dominates (int a, int b) |
calculates if a dominates b, i.e. a is on the path from b to the root More... | |
bool | dominates (VirtualCFG::FilteredCFGNode< CFGFilterFunction > a, VirtualCFG::FilteredCFGNode< CFGFilterFunction > b) |
returns true if node a dominates node b, see dominates(int a,int b) More... | |
VirtualCFG::FilteredCFGNode < CFGFilterFunction > | getCFGNodeFromID (unsigned int id) |
int | getID (VirtualCFG::FilteredCFGNode< CFGFilterFunction > node) |
Public Member Functions inherited from DominatorTreesAndDominanceFrontiers::DominatorForwardBackwardWrapperClass< CFGFilterFunction > | |
DominatorForwardBackwardWrapperClass (Direction dir) | |
Direction | getDirection () |
Private Member Functions | |
void | init () |
inits the internal structures for idom calculation More... | |
void | depthFirstSearch () |
create the dfs-order of the cfg More... | |
void | calculateImmediateDominators () |
calculate immediate dominators More... | |
int | eval (int) |
helperfunction according to lingauer&tarjan More... | |
void | link (int source, int target) |
create the forrest of parents More... | |
void | printInfo () |
debug output More... | |
Private Attributes | |
VirtualCFG::FilteredCFGNode < CFGFilterFunction > | cfgRoot |
std::vector < VirtualCFG::FilteredCFGNode < CFGFilterFunction > > | idToNode |
std::map < VirtualCFG::FilteredCFGNode < CFGFilterFunction >, int > | nodeToIdMap |
std::vector< int > | semi |
internal variables More... | |
std::vector< int > | idom |
std::vector< int > | ancestor |
std::vector< int > | dfsParent |
std::vector< std::set< int > > | buckets |
Additional Inherited Members | |
Protected Member Functions inherited from DominatorTreesAndDominanceFrontiers::DominatorForwardBackwardWrapperClass< CFGFilterFunction > | |
std::vector < VirtualCFG::FilteredCFGEdge < CFGFilterFunction > > | getDirectionModifiedOutEdges (VirtualCFG::FilteredCFGNode< CFGFilterFunction > current) |
helperfunctions to toggle beween pre and post dominator tree More... | |
std::vector < VirtualCFG::FilteredCFGEdge < CFGFilterFunction > > | getDirectionModifiedInEdges (VirtualCFG::FilteredCFGNode< CFGFilterFunction > current) |
VirtualCFG::FilteredCFGNode < CFGFilterFunction > | target (VirtualCFG::FilteredCFGEdge< CFGFilterFunction > outedge) |
VirtualCFG::FilteredCFGNode < CFGFilterFunction > | source (VirtualCFG::FilteredCFGEdge< CFGFilterFunction > outedge) |
Protected Attributes inherited from DominatorTreesAndDominanceFrontiers::DominatorForwardBackwardWrapperClass< CFGFilterFunction > | |
Direction | treeDirection |
TemplatedDominatorTree constructs a dominator/postdominator tree for a cfg. For the template parameter any cfg following Jeremias interface may be used.
Definition at line 80 of file dominanceAnalysis/DominatorTree.h.
DominatorTreesAndDominanceFrontiers::TemplatedDominatorTree< CFGFilterFunction >::TemplatedDominatorTree | ( | SgNode * | head, |
Direction | d = DominatorForwardBackwardWrapperClass <CFGFilterFunction>::PRE_DOMINATOR |
||
) |
constructor for the DT. Head is the start point for the DT construction. DT works for SgFunctionDefintion nodes, unexpected behaviour for non-SgFunctionDefinition!!!
initialize cfg0root correctly
Definition at line 28 of file DominatorTreeImpl.h.
References Dbg::init().
void DominatorTreesAndDominanceFrontiers::TemplatedDominatorTree< CFGFilterFunction >::writeDot | ( | char * | filename) |
writes the DT in DOT-notation to the file given in filename
Definition at line 8 of file DominatorTreeImpl.h.
References escapeString(), and OmpSupport::toString().
|
inline |
Definition at line 102 of file dominanceAnalysis/DominatorTree.h.
References DominatorTreesAndDominanceFrontiers::TemplatedDominatorTree< CFGFilterFunction >::idom.
|
inline |
returns the set of nodes directly dominated by nodeID
Definition at line 108 of file dominanceAnalysis/DominatorTree.h.
References DominatorTreesAndDominanceFrontiers::TemplatedDominatorTree< CFGFilterFunction >::idom.
|
inline |
Definition at line 136 of file dominanceAnalysis/DominatorTree.h.
References DominatorTreesAndDominanceFrontiers::TemplatedDominatorTree< CFGFilterFunction >::idom.
Referenced by DominatorTreesAndDominanceFrontiers::TemplatedDominatorTree< CFGFilterFunction >::dominates(), and DominatorTreesAndDominanceFrontiers::TemplatedDominatorTree< CFGFilterFunction >::getImDomID().
|
inline |
get the ImDomID for given SgNode, returns negative for non-cfg-node
Definition at line 142 of file dominanceAnalysis/DominatorTree.h.
References DominatorTreesAndDominanceFrontiers::TemplatedDominatorTree< CFGFilterFunction >::getID(), and DominatorTreesAndDominanceFrontiers::TemplatedDominatorTree< CFGFilterFunction >::getImDomID().
|
inline |
calculates if a dominates b, i.e. a is on the path from b to the root
Definition at line 153 of file dominanceAnalysis/DominatorTree.h.
References DominatorTreesAndDominanceFrontiers::TemplatedDominatorTree< CFGFilterFunction >::getImDomID().
Referenced by DominatorTreesAndDominanceFrontiers::TemplatedDominatorTree< CFGFilterFunction >::dominates().
|
inline |
returns true if node a dominates node b, see dominates(int a,int b)
Definition at line 166 of file dominanceAnalysis/DominatorTree.h.
References DominatorTreesAndDominanceFrontiers::TemplatedDominatorTree< CFGFilterFunction >::dominates(), and DominatorTreesAndDominanceFrontiers::TemplatedDominatorTree< CFGFilterFunction >::getID().
|
inline |
|
inline |
Definition at line 180 of file dominanceAnalysis/DominatorTree.h.
References DominatorTreesAndDominanceFrontiers::TemplatedDominatorTree< CFGFilterFunction >::nodeToIdMap.
Referenced by DominatorTreesAndDominanceFrontiers::TemplatedDominatorTree< CFGFilterFunction >::dominates(), and DominatorTreesAndDominanceFrontiers::TemplatedDominatorTree< CFGFilterFunction >::getImDomID().
|
private |
inits the internal structures for idom calculation
Definition at line 120 of file DominatorTreeImpl.h.
References sg::ancestor().
|
private |
create the dfs-order of the cfg
Definition at line 40 of file DominatorTreeImpl.h.
References sg::ancestor(), StaticCFG::outEdges(), and VirtualCFG::FilteredCFGNode< FilterFunction >::toString().
|
private |
calculate immediate dominators
Definition at line 209 of file DominatorTreeImpl.h.
|
private |
helperfunction according to lingauer&tarjan
Definition at line 105 of file DominatorTreeImpl.h.
References sg::ancestor().
|
private |
create the forrest of parents
the preformance of the DT-algorithm can be improved by implementing a tree-averaging/redistributing algorithm in eval or link, usually it is done in eval
Definition at line 99 of file DominatorTreeImpl.h.
References sg::ancestor().
|
inlineprivate |
debug output
Definition at line 216 of file dominanceAnalysis/DominatorTree.h.
References DominatorTreesAndDominanceFrontiers::TemplatedDominatorTree< CFGFilterFunction >::ancestor, DominatorTreesAndDominanceFrontiers::TemplatedDominatorTree< CFGFilterFunction >::buckets, DominatorTreesAndDominanceFrontiers::TemplatedDominatorTree< CFGFilterFunction >::idom, DominatorTreesAndDominanceFrontiers::TemplatedDominatorTree< CFGFilterFunction >::idToNode, and DominatorTreesAndDominanceFrontiers::TemplatedDominatorTree< CFGFilterFunction >::semi.
|
private |
Definition at line 194 of file dominanceAnalysis/DominatorTree.h.
Referenced by DominatorTreesAndDominanceFrontiers::TemplatedDominatorTree< CFGFilterFunction >::getCFGNodeFromID().
|
private |
|
private |
Definition at line 199 of file dominanceAnalysis/DominatorTree.h.
Referenced by DominatorTreesAndDominanceFrontiers::TemplatedDominatorTree< CFGFilterFunction >::getID().
|
private |
internal variables
Definition at line 212 of file dominanceAnalysis/DominatorTree.h.
Referenced by DominatorTreesAndDominanceFrontiers::TemplatedDominatorTree< CFGFilterFunction >::printInfo().
|
private |
Definition at line 212 of file dominanceAnalysis/DominatorTree.h.
Referenced by DominatorTreesAndDominanceFrontiers::TemplatedDominatorTree< CFGFilterFunction >::getDirectDominatedSet(), DominatorTreesAndDominanceFrontiers::TemplatedDominatorTree< CFGFilterFunction >::getImDomID(), DominatorTreesAndDominanceFrontiers::TemplatedDominatorTree< CFGFilterFunction >::getSize(), and DominatorTreesAndDominanceFrontiers::TemplatedDominatorTree< CFGFilterFunction >::printInfo().
|
private |
Definition at line 212 of file dominanceAnalysis/DominatorTree.h.
Referenced by DominatorTreesAndDominanceFrontiers::TemplatedDominatorTree< CFGFilterFunction >::printInfo().
|
private |
Definition at line 212 of file dominanceAnalysis/DominatorTree.h.
|
private |
Definition at line 213 of file dominanceAnalysis/DominatorTree.h.
Referenced by DominatorTreesAndDominanceFrontiers::TemplatedDominatorTree< CFGFilterFunction >::printInfo().