]> Cypherpunks repositories - gostls13.git/commit
[dev.typeparams] cmd/compile/internal/types2: adjust unsafe.Alignof/Offsetof/Sizeof
authorRobert Griesemer <gri@golang.org>
Sun, 18 Jul 2021 22:51:31 +0000 (15:51 -0700)
committerRobert Griesemer <gri@golang.org>
Thu, 22 Jul 2021 17:53:51 +0000 (17:53 +0000)
commit80127a7dfe6951fb16d2b67dbe9badb5952e3a2f
tree50cc3650f8a1d9645ea2aa26c34044e96ac29577
parentfca3e5c4452e8dac6c7ae028dcccc323e1d57ed5
[dev.typeparams] cmd/compile/internal/types2: adjust unsafe.Alignof/Offsetof/Sizeof

Changed the implementation such that the result is a variable rather than
a constant if the argument type (or the struct in case of unsafe.Offsetof)
has a size that depends on type parameters.

Minor unrelated adjustments.

For #40301.

Change-Id: I1e988f1479b95648ad95a455c764ead829d75749
Reviewed-on: https://go-review.googlesource.com/c/go/+/335413
Trust: Robert Griesemer <gri@golang.org>
Run-TryBot: Robert Griesemer <gri@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Robert Findley <rfindley@google.com>
src/cmd/compile/internal/types2/builtins.go
src/cmd/compile/internal/types2/builtins_test.go
src/cmd/compile/internal/types2/infer.go
src/cmd/compile/internal/types2/sizes.go
src/cmd/compile/internal/types2/testdata/check/builtins.go2
src/cmd/compile/internal/types2/testdata/fixedbugs/issue40301.go2