public class DominatorTree
extends java.lang.Object
Note: DominatorTree does not currently implement DirectedGraph since it provides 4 methods of navigating the nodes where the meaning of getPredsOf and getSuccsOf diverge from the usual meaning in a DirectedGraph implementation.
If you need a DirectedGraph implementation, see DominatorTreeAdapter.
| Modifier and Type | Field and Description |
|---|---|
protected DominatorsFinder |
dominators |
protected java.util.HashMap |
godeToDode
"gode" is a node in the original graph, "dode" is a node in the
dominator tree.
|
protected DirectedGraph |
graph |
protected DominatorNode |
head |
protected java.util.ArrayList |
tails |
| Constructor and Description |
|---|
DominatorTree(DominatorsFinder dominators) |
| Modifier and Type | Method and Description |
|---|---|
protected void |
buildTree()
Add all the necessary links between nodes to form a meaningful
tree structure.
|
protected DominatorNode |
fetchDode(java.lang.Object gode)
Convenience method, ensures we don't create more than one
DominatorNode for a given block.
|
protected DominatorNode |
fetchParent(java.lang.Object gode) |
java.util.List |
getChildrenOf(DominatorNode node)
Returns the children of node in the tree.
|
DominatorNode |
getDode(java.lang.Object gode)
Returns the DominatorNode for a given node in the original
DirectedGraph.
|
DirectedGraph |
getGraph()
Returns the original graph to which the Dominator tree
pertains.
|
DominatorNode |
getHead()
Returns the root of the dominator tree.
|
DominatorNode |
getParentOf(DominatorNode node)
Returns the parent of node in the tree, null if the node is at
the root.
|
java.util.List<DominatorNode> |
getPredsOf(DominatorNode node)
Finds all the predecessors of node in the original
DirectedGraph and returns a list of the corresponding
DominatorNodes.
|
java.util.List<DominatorNode> |
getSuccsOf(DominatorNode node)
Finds all the successors of node in the original DirectedGraph
and returns a list of the corresponding DominatorNodes.
|
java.util.List |
getTails()
Returns a list of the tails of the dominator tree.
|
boolean |
isDominatorOf(DominatorNode dom,
DominatorNode node)
Returns true if dom dominates node.
|
boolean |
isImmediateDominatorOf(DominatorNode idom,
DominatorNode node)
Returns true if idom immediately dominates node.
|
java.util.Iterator |
iterator()
Returns an iterator over the nodes in the tree.
|
int |
size()
Returns the number of nodes in the tree.
|
protected DominatorsFinder dominators
protected DirectedGraph graph
protected DominatorNode head
protected java.util.ArrayList tails
protected java.util.HashMap godeToDode
public DominatorTree(DominatorsFinder dominators)
public DirectedGraph getGraph()
public DominatorNode getHead()
public java.util.List getTails()
public DominatorNode getParentOf(DominatorNode node)
public java.util.List getChildrenOf(DominatorNode node)
public java.util.List<DominatorNode> getPredsOf(DominatorNode node)
public java.util.List<DominatorNode> getSuccsOf(DominatorNode node)
public boolean isImmediateDominatorOf(DominatorNode idom, DominatorNode node)
public boolean isDominatorOf(DominatorNode dom, DominatorNode node)
public DominatorNode getDode(java.lang.Object gode)
public java.util.Iterator iterator()
public int size()
protected void buildTree()
protected DominatorNode fetchDode(java.lang.Object gode)
protected DominatorNode fetchParent(java.lang.Object gode)
Copyright © 2012-2019 RoboVM AB. All Rights Reserved.