Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CallGraphAnalyzer ¶
type CallGraphAnalyzer struct {
Fset *token.FileSet
Program *ssabuilder.Program
Graph *callgraph.Graph
Packages []*ssa.Package
}
CallGraphAnalyzer builds and inspects the call graph of a Go program.
func NewCallGraphAnalyzer ¶
func NewCallGraphAnalyzer(paths []string) (*CallGraphAnalyzer, error)
NewCallGraphAnalyzer creates a new call graph analyzer from the provided source paths.
func (*CallGraphAnalyzer) AllFunctions ¶
func (cga *CallGraphAnalyzer) AllFunctions() []*ssa.Function
AllFunctions returns all reachable functions in the call graph.
func (*CallGraphAnalyzer) GetCallees ¶
func (cga *CallGraphAnalyzer) GetCallees(fn *ssa.Function) []*ssa.Function
GetCallees returns all functions that are called by the given function.
func (*CallGraphAnalyzer) GetCallers ¶
func (cga *CallGraphAnalyzer) GetCallers(fn *ssa.Function) []*ssa.Function
GetCallers returns all functions that call the given function.
type SSABuilder ¶
type SSABuilder struct {
Fset *token.FileSet // FileSet for position mapping
Program *ssa.Program // SSA program
Packages []*ssa.Package // All loaded SSA packages
Types map[string]*types.Package // Mapping from import path to types.Package
}
SSABuilder is responsible for building SSA representation of Go packages.
func BuildSSA ¶
func BuildSSA(dirs []string) (*SSABuilder, error)
BuildSSA loads packages from the provided directory paths and builds their SSA representation.
Click to show internal directories.
Click to hide internal directories.