Documentation ¶
Overview ¶
Package cfg provides access to control flow graphs of LLVM IR functions.
Index ¶
- type Attrs
- type DominatorTree
- type Edge
- type Graph
- func (g *Graph) AddNode(n graph.Node)
- func (g *Graph) Entry() graph.Node
- func (g *Graph) NewEdge(from, to graph.Node) graph.Edge
- func (g *Graph) NewEdgeWithLabel(from, to graph.Node, label string) *Edge
- func (g *Graph) NewNode() graph.Node
- func (g *Graph) NewNodeWithLabel(label string) *Node
- func (g *Graph) NodeByLabel(label string) (*Node, bool)
- func (g *Graph) RemoveNode(n graph.Node)
- func (g *Graph) SetEntry(entry graph.Node)
- func (g *Graph) SetNodeLabel(n graph.Node, label string)
- type Node
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Attrs ¶
Attrs specifies a set of DOT attributes as key-value pairs.
func (Attrs) Attributes ¶
Attributes returns the DOT attributes of a node or edge.
type DominatorTree ¶
type DominatorTree struct {
flow.DominatorTree
}
A DominatorTree represents a dominator tree.
type Edge ¶
Edge represents an edge of a control flow graph.
func (*Edge) Attributes ¶
Attributes returns the attributes of the edge.
type Graph ¶
type Graph struct { *simple.DirectedGraph // contains filtered or unexported fields }
Graph represents a control flow graph.
func (*Graph) AddNode ¶
AddNode adds the given node to the graph. If the node is an entry node, the graph entry node is updated.
func (*Graph) NewEdgeWithLabel ¶
NewEdgeWithLabel returns a new edge from the source to the destination node in the graph, or the existing edge if already present.
func (*Graph) NewNodeWithLabel ¶
NewNodeWithLabel returns a new node with the given basic block label in the graph, or the existing node if already present.
func (*Graph) NodeByLabel ¶
NodeByLabel returns the node with the given basic block label in the graph. The boolean return value indicates success.
func (*Graph) RemoveNode ¶
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.
type 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.
func (*Node) Attributes ¶
Attributes returns the DOT attributes of the node.
func (*Node) SetAttribute ¶
SetAttribute sets the attribute of the node.