Add a new edge to the control flow graph.
Add a new vertex to the control flow graph.
ControlFlowGraph#addEdge|addEdge() - to add an edge
Get all edges in the graph, independent of their sources and targets. If you are only interested in the edges of a specific node, please use outgoingEdges() or ingoingEdges().
This is the pendant of DataflowGraph#edges|edges() on a DataflowGraph.
Obtain the basic block associated with the given element id (i.e. if this is an element within a basic block, return the blockit belongs to).
Retrieve a vertex by its id.
Check if a vertex with the given id exists in the graph.
the id of the vertex to check
if true, the elements of basic block elements are included in the check, otherwise this will only check the basic blocks themselves
This is the pendant of DataflowGraph#hasVertex|hasVertex() on a DataflowGraph.
Receive all ingoing edges of a given vertex.
This is the pendant of DataflowGraph#outgoingEdges|outgoingEdges() on a DataflowGraph.
outgoingEdges() - for a way to get all outgoing edges of a vertex.
Returns true if the graph may contain basic blocks and false if we know that it does not. This can be used for optimizations.
Merge another control flow graph into this one.
the other control flow graph to merge into this one
should the other graph be assumed to be fully nested (e.g., within a function definition).
This is the pendant of DataflowGraph#mergeWith|mergeWith() on a DataflowGraph.
Receive all outgoing edges of a given vertex.
This is the pendant of DataflowGraph#ingoingEdges|ingoingEdges() on a DataflowGraph.
ingoingEdges() - for a way to get all ingoing edges of a vertex.
Removes a all direct edges between from
and to
from the control flow graph.
This removes the vertex and all edges to and from it.
the id of the vertex to remove
Get all ids of the root vertices — vertices that are not part of any function definition or basic block and hence part of the "top-level" control flow.
This is the pendant of DataflowGraph#rootIds|rootIds() on a DataflowGraph.
Provide a view of all vertices in the graph.
if true, the elements of basic block elements are included in the result, otherwise this will only the basic blocks themselves
This class represents the control flow graph of an R program. The control flow may be hierarchical when confronted with function definitions (see CfgSimpleVertex and CFG#rootVertexIds|rootVertexIds()).
There are two very simple visitors to traverse a CFG:
If you want to prohibit modification, please refer to the ReadOnlyControlFlowGraph interface.