object DominanceFrontiers
Factory to compute DominanceFrontiers.
- Alphabetic
- By Inheritance
- DominanceFrontiers
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Value Members
-
final
def
!=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
##(): Int
- Definition Classes
- AnyRef → Any
-
final
def
==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
def
apply(dt: AbstractDominatorTree, isValidNode: (Int) ⇒ Boolean): DominanceFrontiers
Computes the dominance frontiers for each node of a graph G using the (post) dominator tree.
Computes the dominance frontiers for each node of a graph G using the (post) dominator tree.
- dt
The dominator tree of the specified (flow) graph. We provide basic support for augmented post dominator trees: PostDominatorTree; we in particular handle common cases related to additional exit nodes as created by the implented(!) post dominator tree computation algorithm. However, the following case:
while (true) { if (i < 0) { i += 1000; // Exit Piont 1 } else { i -= 100; // Exit Point 2 } }
is not yet supported; it would require a significant transformation of the computed PDT, which we currently do not perform. Basically, in the PDT we would need to make both bodies dependent on the artifical exit node of the loop to ensure that both bodies are control-dependent on the "if" node.
- isValidNode
A function that returns
trueif the given id represents a node of the underlying graph. If the underlying graph contains a single, new artificial start node then this node may or may not be reported as a valid node; this is not relevant for this algorithm.
// A graph taken from the paper: // Efficiently Computing Static Single Assignment Form and the Control Dependence Graph val g = org.opalj.graphs.Graph.empty[Int] += (0 → 1) += (1 → 2) += (2 → 3) += (2 → 7) += (3 → 4) += (3->5) += (5->6) += (4->6) += (6->8) += (7->8) += (8->9) += (9->10) += (9->11) += (10->11) += (11->9) += (11 -> 12) += (12 -> 13) += (12 ->2) += (0 -> 13) val foreachSuccessor = (n: Int) ⇒ g.successors.getOrElse(n, List.empty).foreach _ val foreachPredecessor = (n: Int) ⇒ g.predecessors.getOrElse(n, List.empty).foreach _ val dt = org.opalj.graphs.DominatorTree(0, false, foreachSuccessor, foreachPredecessor, 13) val isValidNode = (n : Int) => n>= 0 && n <= 13 org.opalj.io.writeAndOpen(dt.toDot(),"g",".dt.gv") val df = org.opalj.graphs.DominanceFrontiers(dt,isValidNode) org.opalj.io.writeAndOpen(df.toDot(),"g",".df.gv") // A degenerated graph which consists of a single node that has a self-reference. val g = org.opalj.graphs.Graph.empty[Int] += (0 → 0) val foreachSuccessor = (n: Int) ⇒ g.successors.getOrElse(n, List.empty).foreach _ val foreachPredecessor = (n: Int) ⇒ g.predecessors.getOrElse(n, List.empty).foreach _ val dtf = org.opalj.graphs.DominatorTreeFactory(0, true, foreachSuccessor, foreachPredecessor, 0) val isValidNode = (n : Int) => n == 0 org.opalj.io.writeAndOpen(dtf.dt.toDot(),"g",".dt.gv") val df = org.opalj.graphs.DominanceFrontiers(dtf,isValidNode) org.opalj.io.writeAndOpen(df.toDot(),"g",".df.gv")
Example: -
final
def
asInstanceOf[T0]: T0
- Definition Classes
- Any
-
def
clone(): AnyRef
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @native() @throws( ... )
-
final
def
eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
def
equals(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
def
finalize(): Unit
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( classOf[java.lang.Throwable] )
-
final
def
getClass(): Class[_]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
-
def
hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
-
final
def
isInstanceOf[T0]: Boolean
- Definition Classes
- Any
-
final
def
ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
final
def
notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
-
final
def
notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
-
final
def
synchronized[T0](arg0: ⇒ T0): T0
- Definition Classes
- AnyRef
-
def
toString(): String
- Definition Classes
- AnyRef → Any
-
final
def
wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @throws( ... )