Documentation ¶
Overview ¶
Code generated by the `ir/codegen` package. DO NOT EDIT.
Code generated by the `ir/codegen` package. DO NOT EDIT.
Index ¶
- func FmtNode(n ir.Node) string
- func Inspect(root ir.Node, visit func(ir.Node) bool)
- func IsAssign(n ir.Node) bool
- func NodeClone(x ir.Node) ir.Node
- func NodeEqual(x, y ir.Node) bool
- func NodeSliceClone(xs []ir.Node) []ir.Node
- func NodeSliceEqual(xs, ys []ir.Node) bool
- func Unparen(e ir.Node) ir.Node
- func Unquote(s string) string
- type NodeSet
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NodeSliceEqual ¶
Types ¶
type NodeSet ¶
type NodeSet struct {
// contains filtered or unexported fields
}
NodeSet is a set of unique AST nodes.
It's possible to avoid allocations in most cases if node set is reused with Reset(). If this is not possible, use NewNodeSet() to create a set that can do fewer allocations than a zero value set.
NodeSet is not thread-safe, but since Root/Block walkers always operate in isolation, we can share on per RootWalker level.
func NewNodeSet ¶
func NewNodeSet() NodeSet
NewNodeSet returns a node set with preallocated storage.
Intended to be used in places where reusing root node set is tricky or impossible (function is reentrant).
func (*NodeSet) Add ¶
Add attempts to insert x into the node set.
Returns true if element was inserted. If x is already in the set, false is returned and no insertion is performed.