public class ControlFlowNode
extends java.lang.Object
Created by covers1624 on 28/2/21.
| Modifier and Type | Field and Description |
|---|---|
@Nullable Block |
block
The block this control flow node is for.
|
int |
cfgIndex
The index in this nodes control flow graph.
|
int |
postOrderNumber
The index of the node in a post-order traversal of the control flow graph, starting at the
end point.
|
boolean |
visited
Visited flag, used in various algorithms.
|
| Constructor and Description |
|---|
ControlFlowNode() |
ControlFlowNode(ControlFlowNode other) |
ControlFlowNode(int cfgIndex) |
ControlFlowNode(int cfgIndex,
Block block) |
| Modifier and Type | Method and Description |
|---|---|
void |
addEdgeTo(ControlFlowNode target) |
boolean |
dominates(ControlFlowNode node)
Gets whether this node dominates the provided node.
|
Block |
getBlock()
Gets the
block, requiring it to be non-null. |
java.util.List<ControlFlowNode> |
getDominatorTreeChildren()
List of children in the dominator tree.
|
ControlFlowNode |
getImmediateDominator()
Gets the immediate dominator (the parent in the dominator tree).
|
@Nullable ControlFlowNode |
getImmediateDominatorOrNull()
Gets the immediate dominator (the parent in the dominator tree).
|
java.util.List<ControlFlowNode> |
getPredecessors() |
java.util.List<ControlFlowNode> |
getSuccessors() |
boolean |
isReachable()
Gets whether this node is reachable.
|
static guru.nidi.graphviz.model.Graph |
makeGraph(ControlFlowNode entry) |
net.covers1624.quack.collection.FastStream<ControlFlowNode> |
streamPostOrder(java.util.function.Function<ControlFlowNode,net.covers1624.quack.collection.FastStream<ControlFlowNode>> children) |
net.covers1624.quack.collection.FastStream<ControlFlowNode> |
streamPreOrder(java.util.function.Function<ControlFlowNode,net.covers1624.quack.collection.FastStream<ControlFlowNode>> children) |
java.lang.String |
toString() |
void |
traversePostOrder(java.util.function.Function<ControlFlowNode,java.util.List<ControlFlowNode>> children,
java.util.function.Consumer<ControlFlowNode> visitor) |
void |
traversePreOrder(java.util.function.Function<ControlFlowNode,java.util.List<ControlFlowNode>> children,
java.util.function.Consumer<ControlFlowNode> visitor) |
public int cfgIndex
@Nullable public @Nullable Block block
public boolean visited
public int postOrderNumber
public ControlFlowNode()
public ControlFlowNode(int cfgIndex)
public ControlFlowNode(ControlFlowNode other)
public ControlFlowNode(int cfgIndex,
Block block)
public void addEdgeTo(ControlFlowNode target)
public void traversePreOrder(java.util.function.Function<ControlFlowNode,java.util.List<ControlFlowNode>> children, java.util.function.Consumer<ControlFlowNode> visitor)
public void traversePostOrder(java.util.function.Function<ControlFlowNode,java.util.List<ControlFlowNode>> children, java.util.function.Consumer<ControlFlowNode> visitor)
public boolean dominates(ControlFlowNode node)
node - The node to check against.public net.covers1624.quack.collection.FastStream<ControlFlowNode> streamPreOrder(java.util.function.Function<ControlFlowNode,net.covers1624.quack.collection.FastStream<ControlFlowNode>> children)
public net.covers1624.quack.collection.FastStream<ControlFlowNode> streamPostOrder(java.util.function.Function<ControlFlowNode,net.covers1624.quack.collection.FastStream<ControlFlowNode>> children)
public Block getBlock()
block, requiring it to be non-null.
(mostly for nullability convenience.)public java.util.List<ControlFlowNode> getPredecessors()
public java.util.List<ControlFlowNode> getSuccessors()
public ControlFlowNode getImmediateDominator()
null if the dominance has not been calculated; or the node is unreachable.
This is an overload for getImmediateDominatorOrNull()
@Nullable public @Nullable ControlFlowNode getImmediateDominatorOrNull()
null if the dominance has not been calculated; or the node is unreachable.public java.util.List<ControlFlowNode> getDominatorTreeChildren()
public boolean isReachable()
public java.lang.String toString()
toString in class java.lang.Objectpublic static guru.nidi.graphviz.model.Graph makeGraph(ControlFlowNode entry)