sccp

package
v1.2.4 Latest Latest
Warning

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

Go to latest
Published: Oct 22, 2026 License: Apache-2.0 Imports: 9 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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