aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/compile/internal/gc/obj.go
diff options
context:
space:
mode:
authorRuss Cox <rsc@golang.org>2020-11-25 00:30:58 -0500
committerRuss Cox <rsc@golang.org>2020-11-25 17:30:40 +0000
commitc26aead50c3c8226c51fb97a94852f2134b881aa (patch)
treeb6e9d775fce43b9c96d290e73adc6403eff13514 /src/cmd/compile/internal/gc/obj.go
parentacb4d1cef14529585266df1868045f80e37ae081 (diff)
downloadgo-c26aead50c3c8226c51fb97a94852f2134b881aa.tar.gz
go-c26aead50c3c8226c51fb97a94852f2134b881aa.zip
[dev.regabi] cmd/compile: convert types.Node (a pointer) to types.IRNode (an interface)
The pointer hack was nice and saved a word, but it's untenable in a world where nodes are themselves interfaces with different underlying types. Bite the bullet and use an interface to hold the Node when in types.Sym and types.Type. This has the nice benefit of removing AsTypesNode entirely. AsNode is still useful because of its nil handling. Change-Id: I298cba9ff788b956ee287283bec78010e8b601e5 Reviewed-on: https://go-review.googlesource.com/c/go/+/272933 Trust: Russ Cox <rsc@golang.org> Run-TryBot: Russ Cox <rsc@golang.org> TryBot-Result: Go Bot <gobot@golang.org> Reviewed-by: Matthew Dempsky <mdempsky@google.com>
Diffstat (limited to 'src/cmd/compile/internal/gc/obj.go')
-rw-r--r--src/cmd/compile/internal/gc/obj.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/cmd/compile/internal/gc/obj.go b/src/cmd/compile/internal/gc/obj.go
index 9f0cefbd1c..05f8358fdf 100644
--- a/src/cmd/compile/internal/gc/obj.go
+++ b/src/cmd/compile/internal/gc/obj.go
@@ -480,7 +480,7 @@ func slicedata(pos src.XPos, s string) *ir.Node {
symname := fmt.Sprintf(".gobytes.%d", slicedataGen)
sym := ir.LocalPkg.Lookup(symname)
symnode := NewName(sym)
- sym.Def = ir.AsTypesNode(symnode)
+ sym.Def = symnode
lsym := sym.Linksym()
off := dstringdata(lsym, 0, s, pos, "slice")