kirin.analysis.callgraph.CallGraph
← Module overview
class
method
sourcemethod
sourcemethod
sourcemethod
classCallGraph¶source
kirin.analysis.callgraph.CallGraph
Bases: Printable
Call graph for a given [`ir.Method`][kirin.ir.Method].
class CallGraph(mt: ir.Method)This class implements the kirin.graph.Graph protocol.
!!! note “Pretty Printing” This object is pretty printable via .print() method.
Parameters
| Name | Type | Description |
|---|---|---|
mt | ir.Method |
Attributes
| Name | Type | Default | Description |
|---|---|---|---|
edges | dict[ir.Method, set[ir.Method]] | {} | Mapping from symbol names to edges (caller -> callee). |
backedges | dict[ir.Method, set[ir.Method]] | {} | Mapping from symbol names to backedges (callee -> caller). |
defs | — | {} |
methodget_neighbors¶source
kirin.analysis.callgraph.CallGraph.get_neighbors
def get_neighbors(node: ir.Method) -> Iterable[ir.Method]Get the neighbors of a node in the call graph.
Parameters
| Name | Type | Description |
|---|---|---|
node | ir.Method |
Returns
Iterable[ir.Method]
methodget_edges¶source
kirin.analysis.callgraph.CallGraph.get_edges
def get_edges() -> Iterable[tuple[ir.Method, ir.Method]]Get the edges of the call graph.
Returns
Iterable[tuple[ir.Method, ir.Method]]
methodget_nodes¶source
kirin.analysis.callgraph.CallGraph.get_nodes
def get_nodes() -> Iterable[ir.Method]Get the nodes of the call graph.
Returns
Iterable[ir.Method]
methodprint_impl¶source
kirin.analysis.callgraph.CallGraph.print_impl