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/sizeof_test.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/sizeof_test.go')
-rw-r--r-- | src/cmd/compile/internal/types/sizeof_test.go | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/cmd/compile/internal/types/sizeof_test.go b/src/cmd/compile/internal/types/sizeof_test.go index 0cf343e8f1..2821d9a3c7 100644 --- a/src/cmd/compile/internal/types/sizeof_test.go +++ b/src/cmd/compile/internal/types/sizeof_test.go @@ -20,8 +20,8 @@ func TestSizeof(t *testing.T) { _32bit uintptr // size on 32bit platforms _64bit uintptr // size on 64bit platforms }{ - {Sym{}, 52, 88}, - {Type{}, 52, 88}, + {Sym{}, 60, 104}, + {Type{}, 56, 96}, {Map{}, 20, 40}, {Forward{}, 20, 32}, {Func{}, 28, 48}, |