Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FindReachable ¶
func FindReachable(state *dataflow.AnalyzerState, excludeMain bool, excludeInit bool, graph DependencyGraph) map[*ssa.Function]bool
FindReachable traverses the call graph starting from the given entry points to find all reachable functions.
It takes a program, a flag for whether to exclude the main function, a flag for whether to exclude init functions, and an optional dependency graph to record cross-package function calls.
The return value is a map from reachable *ssa.Function values to true.
func ReachableFunctionsAnalysis ¶
func ReachableFunctionsAnalysis(state *dataflow.AnalyzerState, excludeMain bool, excludeInit bool, jsonFlag bool)
ReachableFunctionsAnalysis runs the reachable function analysis. Main and Init can be excluded using the boolean flags. The analysis prints the reachable functions on standard output.
Types ¶
type DependencyGraph ¶
A DependencyGraph records package dependencies
func NewDependencyGraph ¶
func NewDependencyGraph() DependencyGraph
NewDependencyGraph returns a new DependencyGraph
func (DependencyGraph) Add ¶
func (dg DependencyGraph) Add(depender string, dependee string)
Add adds a dependency to the graph
func (DependencyGraph) Cycles ¶
func (dg DependencyGraph) Cycles() bool
Cycles returns a boolean indicating whether there is a cycle in the graph or not
func (DependencyGraph) DumpAsGraphviz ¶
func (dg DependencyGraph) DumpAsGraphviz(filename string, includeStdlib bool)
DumpAsGraphviz dumps the graph in its graphviz format in the file with the name provided