import "github.com/decomp/decomp/graph/cfg"
Package cfg provides access to control flow graphs of LLVM IR functions.
cfg.go decode.go dom.go encode.go
Attrs specifies a set of DOT attributes as key-value pairs.
Attributes returns the DOT attributes of a node or edge.
type DominatorTree struct { flow.DominatorTree }
A DominatorTree represents a dominator tree.
NewDom returns a new dominator tree based on the given graph.
func (dt DominatorTree) Dominates(a, b graph.Node) bool
Dominates reports whether A dominates B.
Edge represents an edge of a control flow graph.
Attributes returns the attributes of the edge.
SetAttribute sets the attribute of the edge.
type Graph struct { *simple.DirectedGraph // contains filtered or unexported fields }
Graph represents a control flow graph.
New returns a new control flow graph based on the given function.
ParseFile parses the given Graphviz DOT file into a control flow graph.
AddNode adds the given node to the graph. If the node is an entry node, the graph entry node is updated.
Entry returns the entry node of the control flow graph.
NewEdge returns a new Edge from the source to the destination node.
NewEdgeWithLabel returns a new edge from the source to the destination node in the graph, or the existing edge if already present.
NewNode returns a new graph node with a unique arbitrary ID.
NewNodeWithLabel returns a new node with the given basic block label in the graph, or the existing node if already present.
NodeByLabel returns the node with the given basic block label in the graph. The boolean return value indicates success.
RemoveNode removes n from the graph, as well as any edges attached to it. If the node is not in the graph it is a no-op.
SetEntry sets the entry node of the control flow graph.
SetNodeLabel sets the basic block label of the node.
type Node struct { graph.Node // Basic block label. Label string // DOT attributes. Attrs // contains filtered or unexported fields }
Node represents a node of a control flow graph.
Attributes returns the DOT attributes of the node.
DOTID returns the DOT node ID of the node.
SetAttribute sets the attribute of the node.
SetDOTID sets the DOT node ID of the node.
Package cfg imports 13 packages (graph) and is imported by 3 packages. Updated 2020-01-15. Refresh now. Tools for package owners.