// CalleesOf returns a new set containing all direct callees of the // caller node. func CalleesOf(caller *Node) map[*Node]bool { … } // GraphVisitEdges visits all the edges in graph g in depth-first order. // The edge function is called for each edge in postorder. If it // returns non-nil, visitation stops and GraphVisitEdges returns that // value. func GraphVisitEdges(g *Graph, edge func(*Edge) error) error { … } // PathSearch finds an arbitrary path starting at node start and // ending at some node for which isEnd() returns true. On success, // PathSearch returns the path as an ordered list of edges; on // failure, it returns nil. func PathSearch(start *Node, isEnd func(*Node) bool) []*Edge { … } // DeleteSyntheticNodes removes from call graph g all nodes for // functions that do not correspond to source syntax. For historical // reasons, nodes for g.Root and package initializers are always // kept. // // As nodes are removed, edges are created to preserve the // reachability relation of the remaining nodes. func (g *Graph) DeleteSyntheticNodes() { … } func isInit(fn *ssa.Function) bool { … } // DeleteNode removes node n and its edges from the graph g. // (NB: not efficient for batch deletion.) func (g *Graph) DeleteNode(n *Node) { … } // deleteIns deletes all incoming edges to n. func (n *Node) deleteIns() { … } // deleteOuts deletes all outgoing edges from n. func (n *Node) deleteOuts() { … } // removeOutEdge removes edge.Caller's outgoing edge 'edge'. func removeOutEdge(edge *Edge) { … } // removeInEdge removes edge.Callee's incoming edge 'edge'. func removeInEdge(edge *Edge) { … }