You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

43 lines
1.1 KiB

  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. package pointer
  5. import "fmt"
  6. func (c *addrConstraint) String() string {
  7. return fmt.Sprintf("addr n%d <- {&n%d}", c.dst, c.src)
  8. }
  9. func (c *copyConstraint) String() string {
  10. return fmt.Sprintf("copy n%d <- n%d", c.dst, c.src)
  11. }
  12. func (c *loadConstraint) String() string {
  13. return fmt.Sprintf("load n%d <- n%d[%d]", c.dst, c.src, c.offset)
  14. }
  15. func (c *storeConstraint) String() string {
  16. return fmt.Sprintf("store n%d[%d] <- n%d", c.dst, c.offset, c.src)
  17. }
  18. func (c *offsetAddrConstraint) String() string {
  19. return fmt.Sprintf("offsetAddr n%d <- n%d.#%d", c.dst, c.src, c.offset)
  20. }
  21. func (c *typeFilterConstraint) String() string {
  22. return fmt.Sprintf("typeFilter n%d <- n%d.(%s)", c.dst, c.src, c.typ)
  23. }
  24. func (c *untagConstraint) String() string {
  25. return fmt.Sprintf("untag n%d <- n%d.(%s)", c.dst, c.src, c.typ)
  26. }
  27. func (c *invokeConstraint) String() string {
  28. return fmt.Sprintf("invoke n%d.%s(n%d ...)", c.iface, c.method.Name(), c.params)
  29. }
  30. func (n nodeid) String() string {
  31. return fmt.Sprintf("n%d", n)
  32. }