cmd/compile: use a Sym type instead of interface{} for symbolic offsets

Will help with strongly typed rewrite rules.

Change-Id: Ifbf316a49f4081322b3b8f13bc962713437d9aba
Reviewed-on: https://go-review.googlesource.com/c/go/+/227785
Run-TryBot: Keith Randall <khr@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Daniel Martí <mvdan@mvdan.cc>
This commit is contained in:
Keith Randall 2020-04-09 20:28:55 -07:00
parent 782fcb44b9
commit ea7126fe14
9 changed files with 81 additions and 53 deletions

View file

@ -311,6 +311,10 @@ func (n *Node) pkgFuncName() string {
return p + "." + s.Name
}
// The compiler needs *Node to be assignable to cmd/compile/internal/ssa.Sym.
func (n *Node) CanBeAnSSASym() {
}
// Name holds Node fields used only by named nodes (ONAME, OTYPE, OPACK, OLABEL, some OLITERAL).
type Name struct {
Pack *Node // real package for import . names