graph

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Aug 27, 2020 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Overview

Package graph defines an abstraction of the SSA graph that facilitates rendering.

Index

Constants

View Source
const (
	// Referrer represents a node that is referred to as per ssa.Value.Referrers
	Referrer relationship = iota
	// Operand represents a node that is an operand of an instruction as per ssa.Instr.Operands
	Operand
)

Variables

This section is empty.

Functions

This section is empty.

Types

type FuncGraph

type FuncGraph struct {
	// F is the function whose graph this is
	F *ssa.Function
	// Children is a mapping from each node to its children (referrers + operands)
	Children map[ssa.Node][]Node
	// contains filtered or unexported fields
}

FuncGraph represents the SSA graph for an ssa.Function.

func New

func New(f *ssa.Function) *FuncGraph

New returns a new Graph constructed from a given function.

type Node

type Node struct {
	// N is the ssa.Node wrapped by this type.
	N ssa.Node
	// R is the relationship between this node and its parent in the SSA graph.
	R relationship
}

Node represents a node in the SSA graph, along with its relationship to a parent node.

Jump to

Keyboard shortcuts

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