CallGraph Class

Definition

A kind of call graph whose nodes represent Q# callables or type parameterized callables.

public sealed class CallGraph
type CallGraph = class
Public NotInheritable Class CallGraph
Inheritance
CallGraph

Constructors

CallGraph(IEnumerable<QsCallable>)

Constructs a call graph from callables.

CallGraph(QsCompilation, Boolean)

Constructs a call graph from a compilation. The optional trim argument may be used to specify the call graph to be trimmed to only include callables that entry points are dependent on.

Properties

Nodes

A hash set of the nodes in the call graph.

Methods

GetCallCycles()

Finds and returns a list of all cycles in the call graph, each one being represented by an array of nodes. To get the edges between the nodes of a given cycle, use the GetDirectDependencies method.

GetDirectDependencies(CallGraphNode)

Returns the children nodes of a given node. Each key in the returned lookup is a child node of the given node. Each value in the lookup is an edge connecting the given node to the child node represented by the associated key. Returns an empty ILookup if the node was found with no dependencies or was not found in the graph.

VerifyAllCycles(Func<ImmutableArray<CallGraphNode>,Boolean>)

Given a call graph edges, finds all cycles and determines if each is valid. Invalid cycles are those that cause type parameters to be mapped to other type parameters of the same callable (constricting resolutions) or to a type containing a nested reference to the same type parameter, i.e Foo.A -> Foo.A[]. If a cycleSelector is given, checks only the cycles for which it returns true. Returns an enumerable of tuples for each edge of each invalid cycle found, each tuple containing a diagnostic and the callable name where the diagnostic should be placed.

Applies to