ssa

package
v1.5.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 29, 2025 License: MIT Imports: 9 Imported by: 0

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 []*ssabuilder.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() []*ssabuilder.Function

AllFunctions returns all reachable functions in the call graph.

func (*CallGraphAnalyzer) GetCallees

func (cga *CallGraphAnalyzer) GetCallees(fn *ssabuilder.Function) []*ssabuilder.Function

GetCallees returns all functions that are called by the given function.

func (*CallGraphAnalyzer) GetCallers

func (cga *CallGraphAnalyzer) GetCallers(fn *ssabuilder.Function) []*ssabuilder.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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL