1
0
mirror of https://github.com/golang/go synced 2024-09-29 16:24:28 -06:00

[dev.regabi] cmd/compile: reorganize ir/fmt.go

This code is a few layer of abstraction stacked up on top
of each other, and they're hard to see all at the same time
because the file is pretty mixed up. As much as I try to avoid
code rearrangement to keep history, this one is long overdue.

A followup CL will cut out some of the layers, and the diff will be
much clearer what's going on with the code ordered with
callers near callees, as it is now.

Passes buildall w/ toolstash -cmp.

Change-Id: Iffc49d43cf4be9fab47e2dd59a5f98930573350f
Reviewed-on: https://go-review.googlesource.com/c/go/+/275773
Trust: Russ Cox <rsc@golang.org>
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
This commit is contained in:
Russ Cox 2020-12-05 00:02:46 -05:00
parent a79742f39a
commit 158c9dd131
2 changed files with 641 additions and 639 deletions

File diff suppressed because it is too large Load Diff

View File

@ -116,6 +116,12 @@ type Node interface {
CanBeAnSSASym()
}
// Line returns n's position as a string. If n has been inlined,
// it uses the outermost position where n has been inlined.
func Line(n Node) string {
return base.FmtPos(n.Pos())
}
func IsSynthetic(n Node) bool {
name := n.Sym().Name
return name[0] == '.' || name[0] == '~'