The CallGraph class represents a directed graph where nodes correspond to functions or methods in a program, and edges indicate calls between them.

Nodes and edges are uniquely identified using indices generated by IdxGenerator. This class provides methods to construct the graph from AST data, retrieve nodes and edges, and check connectivity between nodes.

Constructors

Methods

  • Determines if there exists a path in the call graph from the source node to the destination node. This method performs a breadth-first search to find if the destination node is reachable from the source node.

    Parameters

    • src: CGNodeId

      The ID of the source node to start the search from

    • dst: CGNodeId

      The ID of the destination node to search for

    Returns boolean

    true if there exists a path from src to dst in the call graph, false otherwise Returns false if either src or dst node IDs are not found in the graph