public abstract class Dominators<T> extends Object
Sources: TOPLAS article, Muchnick book
| Modifier and Type | Class and Description |
|---|---|
protected class |
Dominators.DominatorInfo
LOOK-ASIDE TABLE FOR PER-NODE STATE AND ITS ACCESSORS
|
| Modifier and Type | Field and Description |
|---|---|
protected Graph<T> |
G
a convenient place to locate the graph to avoid passing it internally
|
protected int |
reachableNodeCount
the number of nodes reachable from the root
|
protected T |
root
the root node from which to build dominators
|
| Constructor and Description |
|---|
Dominators(Graph<T> G,
T root) |
| Modifier and Type | Method and Description |
|---|---|
protected void |
analyze()
analyze dominators
|
Iterator<T> |
dominators(T node)
return an Iterator over all nodes that dominate node
|
Graph<T> |
dominatorTree()
return the dominator tree, which has an edge from n to n' if n dominates n'
|
T |
getIdom(T node)
return the immediate dominator of node
|
protected abstract Dominators.DominatorInfo |
getInfo(T node) |
boolean |
isDominatedBy(T node,
T master)
is node dominated by master?
|
static <T> Dominators<T> |
make(Graph<T> G,
T root) |
String |
toString() |
protected final T root
protected int reachableNodeCount
public Dominators(Graph<T> G, T root) throws IllegalArgumentException
G - The graphroot - The root from which to compute dominatorsIllegalArgumentException - if G is nullpublic static <T> Dominators<T> make(Graph<T> G, T root)
public Iterator<T> dominators(T node)
public Graph<T> dominatorTree()
protected void analyze()
protected abstract Dominators.DominatorInfo getInfo(T node)