callgraph

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Aug 10, 2026 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Overview

Package callgraph builds a directed graph of function calls within user packages and identifies cleat leaves (functions that directly call HostCalls methods).

Package callgraph builds a directed graph of function calls within user packages and identifies cleat leaves — functions that directly call HostCalls methods.

The graph is used by the closure package to compute transitive closure for WASM compilation.

Key types:

  • Graph — directed call graph with forward and reverse edges

Key functions:

  • Build — constructs a call graph from analyzer.AnalysisResult

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Graph

type Graph struct {
	// Calls maps caller → set of callees (fully-qualified names).
	Calls map[string]map[string]bool

	// CalledBy maps callee → set of callers (reverse edges).
	CalledBy map[string]map[string]bool

	// DurableLeaves maps fully-qualified names of functions that directly
	// call at least one HostCalls method.
	DurableLeaves map[string]bool
}

Graph represents the directed call graph of functions.

func Build

func Build(result *analyzer.AnalysisResult) (*Graph, error)

Build constructs a call graph from the given analysis result.

func (*Graph) NumEdges

func (g *Graph) NumEdges() int

NumEdges returns the total number of edges in the call graph.

func (*Graph) String

func (g *Graph) String() string

String returns a human-readable summary.

Jump to

Keyboard shortcuts

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