]> Cypherpunks repositories - gostls13.git/commit
cmd/compile: handle blank struct fields in NumComponents
authorJosh Bleecher Snyder <josharian@gmail.com>
Fri, 30 Mar 2018 19:25:02 +0000 (12:25 -0700)
committerJosh Bleecher Snyder <josharian@gmail.com>
Sat, 7 Apr 2018 21:01:07 +0000 (21:01 +0000)
commitbbfae469a1d207a415dd813d799df1ed2dd2d80a
tree9b0e0a639daccb7f5d8644022f733b5c178dfbd2
parentd8b417e00b3f19f7fb47aaa64fe107ed59f6603f
cmd/compile: handle blank struct fields in NumComponents

NumComponents is used by racewalk to decide whether reads and writes
might occur to subobjects of an address. For that purpose,
blank fields matter.

It is also used to decide whether to inline == and != for a type.
For that purpose, blank fields may be ignored.

Add a parameter to NumComponents to support this distinction.
While we're here, document NumComponents, as requested in CL 59334.

Change-Id: I8c2021b172edadd6184848a32a74774dde1805c8
Reviewed-on: https://go-review.googlesource.com/103755
Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
src/cmd/compile/internal/gc/racewalk.go
src/cmd/compile/internal/gc/walk.go
src/cmd/compile/internal/types/type.go