diff options
author | Russ Cox <rsc@golang.org> | 2020-11-27 23:52:37 -0500 |
---|---|---|
committer | Russ Cox <rsc@golang.org> | 2020-11-30 18:33:47 +0000 |
commit | 65f4ec2faec54b7a3e70f2404132df9d83df11e0 (patch) | |
tree | ed1812824b1d385c28bc04b565f961c30fbcd9bc /src/cmd/compile/internal/types/sizeof_test.go | |
parent | 88e33f6ecb9ea44a464bd3863f8037bc081b2a6e (diff) | |
download | go-65f4ec2faec54b7a3e70f2404132df9d83df11e0.tar.gz go-65f4ec2faec54b7a3e70f2404132df9d83df11e0.zip |
[dev.regabi] cmd/compile: cleanup label handling
- The use of a label's Name.Defn to point at the named for/select/switch
means that any rewrite of the for/select/switch must overwrite the original
or else the pointer will dangle. Remove that pointer by adding the label
name directly to the for/select/switch representation instead.
- The only uses of a label's Sym.Label were ephemeral values during
markbreak and escape analysis. Use a map for each. Although in general
we are not going to replace all computed fields with maps (too slow),
the one in markbreak is only for labeled for/select/switch, and the one
in escape is for all labels, but even so, labels are fairly rare.
In theory this cleanup should make it easy to allow labeled for/select/switch
in inlined bodies, but this CL does not attempt that. It's only concerned
with cleanup to enable a new Node representation.
Passes buildall w/ toolstash -cmp.
Change-Id: I7e36ee98d2ea40dbae94e6722d585f007b7afcfa
Reviewed-on: https://go-review.googlesource.com/c/go/+/274086
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 | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/cmd/compile/internal/types/sizeof_test.go b/src/cmd/compile/internal/types/sizeof_test.go index 2821d9a3c7..88a2fbba2f 100644 --- a/src/cmd/compile/internal/types/sizeof_test.go +++ b/src/cmd/compile/internal/types/sizeof_test.go @@ -20,7 +20,7 @@ func TestSizeof(t *testing.T) { _32bit uintptr // size on 32bit platforms _64bit uintptr // size on 64bit platforms }{ - {Sym{}, 60, 104}, + {Sym{}, 52, 88}, {Type{}, 56, 96}, {Map{}, 20, 40}, {Forward{}, 20, 32}, |