Class DominatorTree<N>
java.lang.Object
com.google.javascript.jscomp.graph.DominatorTree<N>
- Type Parameters:
N- Value type that the graph node stores.
Computes the dominator tree of a directed graph.
A node d dominates a node n if every path from the entry node to n must go through d.
The "immediate dominator" of n is the unique dominator d of n such that d != n and d is dominated by every other dominator of n (excluding n itself).
This implementation uses the iterative algorithm by Cooper, Harvey, and Kennedy. See .
-
Method Summary
Modifier and TypeMethodDescriptionstatic <N> DominatorTree<N> Computes the dominator tree for the given graph starting from the entry node.intgetDominatedSubtreeSize(N node) getImmediateDominator(N node)
-
Method Details
-
compute
Computes the dominator tree for the given graph starting from the entry node.- Parameters:
graph- The directed graph to analyze.entry- The entry node of the graph.- Returns:
- A
DominatorTreeinstance.
-
getImmediateDominator
-
getDominatedSubtreeSize
-
getAllSubtreeSizes
-