]> Cypherpunks repositories - gostls13.git/commit
cmd/compile: add types.SoleComponent, use in convFuncName
authorJosh Bleecher Snyder <josharian@gmail.com>
Wed, 7 Nov 2018 00:27:58 +0000 (16:27 -0800)
committerJosh Bleecher Snyder <josharian@gmail.com>
Wed, 27 Feb 2019 18:07:42 +0000 (18:07 +0000)
commit9892ccff23c94c5fabd704ff0c027d45b7b03cb8
tree1a630fad380e4883d847f9790cdfc685eab675fe
parent694cd005c3943027a4533a0a534837108ccd66f6
cmd/compile: add types.SoleComponent, use in convFuncName

The specialized conversion functions care only
about a type's layout in memory, so e.g.
[1]string is equivalent to string.

Add types.SoleComponent to assist with such use cases,
and use it for the specialized conversion functions.

Increases the number of convTstring calls by ~1%.

Change-Id: I09a392909f2037387b30642781e65f707a048af5
Reviewed-on: https://go-review.googlesource.com/c/148577
Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
src/cmd/compile/internal/gc/walk.go
src/cmd/compile/internal/types/type.go