flow

package
v0.0.0-...-9bf0539 Latest Latest
Warning

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

Go to latest
Published: Mar 4, 2023 License: BSD-3-Clause Imports: 1 Imported by: 0

Documentation

Overview

Package flow provides control flow analysis functions.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DominatorTree

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

DominatorTree is a flow graph dominator tree.

func Dominators

func Dominators(root graph.Node, g graph.Directed) DominatorTree

Dominators returns a dominator tree for all nodes in the flow graph g starting from the given root node.

func DominatorsSLT

func DominatorsSLT(root graph.Node, g graph.Directed) DominatorTree

DominatorsSLT returns a dominator tree for all nodes in the flow graph g starting from the given root node using the sophisticated version of the Lengauer-Tarjan algorithm. The SLT algorithm may outperform the simple LT algorithm for very large dense graphs.

func (DominatorTree) DominatedBy

func (d DominatorTree) DominatedBy(id int64) []graph.Node

DominatedBy returns a slice of all nodes immediately dominated by the node with the given ID. Elements of the slice are retained by the DominatorTree.

func (DominatorTree) DominatorOf

func (d DominatorTree) DominatorOf(id int64) graph.Node

DominatorOf returns the immediate dominator of the node with the given ID.

func (DominatorTree) Root

func (d DominatorTree) Root() graph.Node

Root returns the root of the tree.

Jump to

Keyboard shortcuts

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