public class CFGraph extends DFAGraph
DFANode
class is used to represent each node in the graph.
The nodes in a CFGraph object contain information gathered from
their corresponding Cetus IR and these data can be accessed with the
DFANode.getData(String)
method.
Following key:data pairs are added to each node by default after calling
the constructor of CFGraph.
DFAGraph.TopIterator
Constructor and Description |
---|
CFGraph(NestedDeclarator t,
boolean arrayDecl)
Constructs a CFGraph object for NestedDeclarator, which is used by def-use/use-def chain computation.
|
CFGraph(Traversable t)
Constructs a CFGraph object with the given traversable object.
|
CFGraph(Traversable t,
java.lang.Class<? extends Traversable> supernode)
Constructs a CFGraph object with the given traversable object and the
IR type whose sub graph is pruned.
|
CFGraph(Traversable t,
java.lang.Class<? extends Traversable> supernode,
boolean includeDeclarator,
java.util.List<VariableDeclaration> paramList)
Constructs a CFGraph object which is used by def-use/use-def chain computation.
|
CFGraph(VariableDeclarator t,
boolean arrayDecl)
Constructs a CFGraph object for VariableDeclarator, which is used by def-use/use-def chain computation.
|
Modifier and Type | Method and Description |
---|---|
DFANode |
getCallNode(FunctionCall fc)
Returns the DFANode object that contains the given function call.
|
DFANode |
getEntry() |
static java.lang.Object |
getIR(DFANode node)
Returns the corresponding IR object for the specified node.
|
void |
normalize()
Normalizes the graph so that each node does not have an assignment
expression as a sub expression of another expression.
|
java.lang.String |
toDot()
Converts the graph to a string in dot format to be used with GraphViz.
|
absorb, addEdge, addNode, getEntryNodes, getExitNodes, getFirst, getLast, getNode, getNode, getNodeWith, getSCC, isEmpty, isReachable, iterator, removeEdge, removeNode, removeNodes, size, toDot, topologicalSort, topologicalSortOptimized, toString
public CFGraph(Traversable t)
t
- the traversable object.public CFGraph(Traversable t, java.lang.Class<? extends Traversable> supernode)
t
- the traversable object.supernode
- IR type that is pruned.public CFGraph(VariableDeclarator t, boolean arrayDecl)
t
- a variable declaratorarrayDecl
- a boolean for declarator with arrayspublic CFGraph(NestedDeclarator t, boolean arrayDecl)
t
- a nested declaratorarrayDecl
- a boolean for declarator with arrayspublic CFGraph(Traversable t, java.lang.Class<? extends Traversable> supernode, boolean includeDeclarator, java.util.List<VariableDeclaration> paramList)
t
- a traversablesupernode
- includeDeclarator
- paramList
- public java.lang.String toDot()
DFAGraph.toDot(String,int)
for more flexible formatting.DFAGraph.toDot(String,int)
public static java.lang.Object getIR(DFANode node)
node
- the node in the graph.public DFANode getEntry()
public void normalize()
public DFANode getCallNode(FunctionCall fc)