constantpropagation

package
v0.0.33 Latest Latest
Warning

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

Go to latest
Published: Sep 22, 2022 License: MIT Imports: 18 Imported by: 0

README

Constant Propagation Analysis

analysis.go

This file implements pkg/toolkits/scalar.FlowAnalysis

switcher.go

This file implements pkg/golang/switcher.Switcher

runner.go

This file encapsulates a Runner
You can use function NewRunner outside the package to construct a Runner easily

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ConstantPropagationAnalysis

type ConstantPropagationAnalysis struct {
	scalar.BaseFlowAnalysis
	// contains filtered or unexported fields
}

ConstantPropagationAnalysis represents a constant propagtion analysis

func New

New creates a ConstantPropagationAnalysis

func (*ConstantPropagationAnalysis) End

func (a *ConstantPropagationAnalysis) End(universe []*entry.Entry)

End handle result of analysis

func (*ConstantPropagationAnalysis) FlowThrougth

func (a *ConstantPropagationAnalysis) FlowThrougth(inMap *map[any]any, unit ssa.Instruction, outMap *map[any]any)

FlowThrougth calculate outMap based on inMap and unit

func (*ConstantPropagationAnalysis) NewInitalFlow

func (a *ConstantPropagationAnalysis) NewInitalFlow() *map[any]any

NewInitalFlow returns a new flow

type ConstantPropagationSwitcher

type ConstantPropagationSwitcher struct {
	switcher.BaseSwitcher
	// contains filtered or unexported fields
}

ConstantPropagationSwitcher represents a constant propagtion switcher

func (*ConstantPropagationSwitcher) CaseBinOp

func (s *ConstantPropagationSwitcher) CaseBinOp(inst *ssa.BinOp)

CaseBinOp accepts a BinOp instruction

func (*ConstantPropagationSwitcher) CasePhi

func (s *ConstantPropagationSwitcher) CasePhi(inst *ssa.Phi)

CasePhi accepts a Phi instruction

type Runner

type Runner struct {
	Src      string
	Function string
}

Runner represents a constant propagation runner

func NewRunner added in v0.0.24

func NewRunner(src string, function string) *Runner

func (*Runner) Run

func (r *Runner) Run()

Run kick off the analysis

Jump to

Keyboard shortcuts

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