ssa

package
v0.0.0-...-ab3fba8 Latest Latest
Warning

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

Go to latest
Published: Nov 20, 2021 License: GPL-3.0 Imports: 5 Imported by: 0

Documentation

Overview

Package ssa is responsible for turning a control-flow graph (CFG) of a function into an intermediate representation (IR), which adheres to static single assignment (SSA).

While generating the IR, We have two noteworthy challenges:

  1. Maintain variable usage counts (x_0, x_1, ... x_n)
  2. Insert phi nodes after branch points

As C0 does not permit variable shadowing, scoping issues are easier to manage. Our first approach to phi nodes will be wasteful as we are more interested about a working implementation than efficiency.

Note: The SSA generation is meant to be called on per-function basis. The aggregate instructions of these separate runs forms the complete program.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type SSA

type SSA struct {
	Instructions []ir.Instruction
	Errors       []error
	// contains filtered or unexported fields
}

func New

func New(c *cfg.CFG) *SSA

func (*SSA) Dump

func (s *SSA) Dump() string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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