ReadonlychildrenThe vertices nested within the given one, which for a function definition is the body it holds. Nothing flows into such a region, so this is the only way a traversal can step into it.
ReadonlydataflowThe dataflow graph this control flow graph is a view of, undefined once it holds a copy of its own.
It knows the ast as well, so a traversal needs nothing but the control flow to reach either.
ReadonlydecidesThe constructs whose outcome this vertex decides, e.g. the if a condition belongs to.
Since a construct is reached only once its parts have run, standing on the condition is the moment to ask what that condition is for.
entryOf() - for the way back, from the construct to its condition
ReadonlyedgesGet all edges in the graph, independent of their sources and targets (see ControlFlowGraph for their order). If you are only interested in the edges of a specific node, please use outgoingEdges() or ingoingEdges(). This is the pendant of edges() on a DataflowGraph.
ReadonlyedgesThe edges leaving the given vertex, i.e. what may be evaluated after it, answering with the shared empty
NoEdges rather than with undefined for a vertex that has none.
This is the pendant of edgesFrom() on a DataflowGraph.
edgesTo() - for what may be evaluated before it
ReadonlyedgesThe edges leading into the given vertex, i.e. what may be evaluated before it, answering with the shared
empty NoEdges rather than with undefined for a vertex that has none.
This is the pendant of edgesTo() on a DataflowGraph.
edgesFrom() - for what may be evaluated after it
ReadonlyentryThe vertex control flow enters the construct rooted at id at, i.e. the first thing it evaluates.
For if(u) a else b that is the condition, for 2 * 3 the left operand, and for a leaf the leaf itself.
undefined if the construct is not part of the control flow at all.
exitOf() - for where it is over
ReadonlyexitThe vertex a construct is over at, i.e. where its branches join and control flow continues past it.
The control flow is modeled in post-order: everything a construct is made of is evaluated before the
construct itself, so an if is over on the if vertex, a loop on its loop vertex, and 2 * 3 on the
* vertex. There is no separate marker to look for — reaching the vertex is the construct ending.
entryOf() - for where it begins instead
ReadonlygetObtain 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).
ReadonlygetRetrieve a vertex by its id.
the id of the vertex to retrieve
OptionalincludeBlocks: boolean
if true, the elements of basic block elements are included in the result, otherwise this will only the basic blocks themselves
This is the pendant of <a href="../classes/src_dataflow_graph_graph.DataflowGraph.html#getvertex" class="tsd-kind-method">getVertex()</a> on a <a href="../classes/src_dataflow_graph_graph.DataflowGraph.html" class="tsd-kind-class">DataflowGraph</a>.
ReadonlyhasCheck if a vertex with the given id exists in the graph.
the id of the vertex to check
OptionalincludeBlocks: boolean
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 <a href="../classes/src_dataflow_graph_graph.DataflowGraph.html#hasvertex" class="tsd-kind-method">hasVertex()</a> on a <a href="../classes/src_dataflow_graph_graph.DataflowGraph.html" class="tsd-kind-class">DataflowGraph</a>.
ReadonlyingoingThe edges leading into the given vertex, i.e. what may be evaluated before it.
ReadonlymayReturns true if the graph may contain basic blocks and false if we know that it does not. This can be used for optimizations.
ReadonlyoutgoingThe edges leaving the given vertex, i.e. what may be evaluated after it.
ReadonlypredecessorsThe vertices control flow may come from to reach id, i.e. what may have been evaluated before.
successors() - for the other direction
ReadonlyrootGet 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 rootIds() on a DataflowGraph.
ReadonlysuccessorsThe vertices control flow may reach directly from id, i.e. what may be evaluated next.
Prefer this over walking the edges by hand: a graph that is a view on another structure (see ControlFlowGraph) may answer it without projecting itself at all.
predecessors() - for the other direction
ReadonlyverticesProvide a view of all vertices in the graph.
A read-only view of the ControlFlowGraph.