sccp

package
v1.1.3 Latest Latest
Warning

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

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

Documentation

Overview

Package sccp implements sparse conditional constant propagation for golang.org/x/tools/go/ssa. It is a faithful adaptation of the Go compiler's implementation in cmd/compile/internal/ssa/sccp.go; the algorithm, structure and comments follow the original closely, with only the necessary changes to map the compiler's value-based IR (Op/AuxInt) onto go/ssa's instruction-based IR (token.Token/constant.Value).

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Edge

type Edge struct {
	// contains filtered or unexported fields
}

Edge represents a CFG edge, mirroring cmd/compile's ssa.Edge: b is the destination block and i is the index of this edge in b.Preds.

type Pass

type Pass struct{}

Pass runs sparse conditional constant propagation on every function of a built SSA package.

func (Pass) Run

func (Pass) Run(pkg *ssa.Package) error

Run applies sccp to all functions (including anonymous functions and declared methods) of pkg.

Jump to

Keyboard shortcuts

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