diff options
author | Tim King <taking@google.com> | 2021-09-22 09:50:15 -0700 |
---|---|---|
committer | Tim King <taking@google.com> | 2022-04-22 17:17:20 +0000 |
commit | d567bc1c220c9afb5f71dc38550ef8b0262ff544 (patch) | |
tree | bf728634567d86d32e86038077f80345d88b71c8 /godoc | |
parent | 5d7ca8a1b5bc80222ed6375e345ba8b6e24e9515 (diff) | |
download | golang-x-tools-d567bc1c220c9afb5f71dc38550ef8b0262ff544.tar.gz |
go/ssa: monomorphize generic instantiations.
Monomorphize the instantiation of generic functions. Applies type
substitution while building the function instantiation.
Adds a new BuilderMode, ssa.InstantiateGenerics, to enable
monomorphization. InstantiateGenerics is turned on by the flag 'G' in
tools that specify the BuilderMode.
Adds a parameterized field to Program to detect when a MethodValue is
parameterized.
Thunk creation creates new MethodExpr selections. Adds a new methodExpr
type to construct a MethodExpr from outside of types, and selection
interface to generalize a *methodExpr and *types.Selection.
Tests x/tools/go/ssa/interp against the runnable examples in
$GOROOT/test/typeparam/*.go. Some additional models to support files.
Misc. cleanup:
- adding (*canonizer).instantiateMethod to create a canonical
representative of a method.
- documenting builder.go
- adding (*subster).types that applies type substitution to a list.
Updates golang/go#48525
Change-Id: I885a4223900feaa3664e35caf8618d11ba16a2a7
Reviewed-on: https://go-review.googlesource.com/c/tools/+/356315
Reviewed-by: Dominik Honnef <dominik@honnef.co>
Reviewed-by: Robert Findley <rfindley@google.com>
Reviewed-by: Zvonimir Pavlinovic <zpavlinovic@google.com>
Run-TryBot: Tim King <taking@google.com>
gopls-CI: kokoro <noreply+kokoro@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Diffstat (limited to 'godoc')
0 files changed, 0 insertions, 0 deletions