1// Copyright 2013 The Go Authors. All rights reserved.
2// Use of this source code is governed by a BSD-style
3// license that can be found in the LICENSE file.
4
5package pointer
6
7import "fmt"
8
9func (c *addrConstraint) String() string {
10	return fmt.Sprintf("addr n%d <- {&n%d}", c.dst, c.src)
11}
12
13func (c *copyConstraint) String() string {
14	return fmt.Sprintf("copy n%d <- n%d", c.dst, c.src)
15}
16
17func (c *loadConstraint) String() string {
18	return fmt.Sprintf("load n%d <- n%d[%d]", c.dst, c.src, c.offset)
19}
20
21func (c *storeConstraint) String() string {
22	return fmt.Sprintf("store n%d[%d] <- n%d", c.dst, c.offset, c.src)
23}
24
25func (c *offsetAddrConstraint) String() string {
26	return fmt.Sprintf("offsetAddr n%d <- n%d.#%d", c.dst, c.src, c.offset)
27}
28
29func (c *typeFilterConstraint) String() string {
30	return fmt.Sprintf("typeFilter n%d <- n%d.(%s)", c.dst, c.src, c.typ)
31}
32
33func (c *untagConstraint) String() string {
34	return fmt.Sprintf("untag n%d <- n%d.(%s)", c.dst, c.src, c.typ)
35}
36
37func (c *invokeConstraint) String() string {
38	return fmt.Sprintf("invoke n%d.%s(n%d ...)", c.iface, c.method.Name(), c.params)
39}
40
41func (n nodeid) String() string {
42	return fmt.Sprintf("n%d", n)
43}
44