Builds call graph edges between function definitions.
Summary
Functions
Builds a call graph from a list of IR nodes (typically a whole module).
Collects all function definitions as {function_id, ir_node} pairs.
Finds which function definition contains a given node, based on the IR tree.
Types
@type function_id() :: {module(), atom(), non_neg_integer()}
Functions
@spec build( [Reach.IR.Node.t()], keyword() ) :: Graph.t()
Builds a call graph from a list of IR nodes (typically a whole module).
Returns a Graph.t() where vertices are {module, function, arity} tuples
and edges are labeled with the call site node ID.
@spec collect_function_defs([Reach.IR.Node.t()], module() | nil) :: [ {function_id(), Reach.IR.Node.t()} ]
Collects all function definitions as {function_id, ir_node} pairs.
@spec find_enclosing_function([Reach.IR.Node.t()], Reach.IR.Node.id()) :: function_id() | nil
Finds which function definition contains a given node, based on the IR tree.