diff options
author | Russ Cox <rsc@golang.org> | 2020-11-25 00:30:58 -0500 |
---|---|---|
committer | Russ Cox <rsc@golang.org> | 2020-11-25 17:30:40 +0000 |
commit | c26aead50c3c8226c51fb97a94852f2134b881aa (patch) | |
tree | b6e9d775fce43b9c96d290e73adc6403eff13514 /src/cmd/compile/internal/types/sym.go | |
parent | acb4d1cef14529585266df1868045f80e37ae081 (diff) | |
download | go-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/types/sym.go')
-rw-r--r-- | src/cmd/compile/internal/types/sym.go | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/cmd/compile/internal/types/sym.go b/src/cmd/compile/internal/types/sym.go index 07bce4d5cd..046104d0dc 100644 --- a/src/cmd/compile/internal/types/sym.go +++ b/src/cmd/compile/internal/types/sym.go @@ -33,12 +33,12 @@ type Sym struct { Name string // object name // saved and restored by dcopy - Def *Node // definition: ONAME OTYPE OPACK or OLITERAL + Def IRNode // definition: ONAME OTYPE OPACK or OLITERAL Block int32 // blocknumber to catch redeclaration Lastlineno src.XPos // last declaration for diagnostic flags bitset8 - Label *Node // corresponding label (ephemeral) + Label IRNode // corresponding label (ephemeral) Origpkg *Pkg // original package for . import } |