go/go
Tim King 36a5c6a8a6 go/ssa: build generic function bodies
ssa now always builds the bodies of generic functions and methods.
Within the bodies of generic functions, parameterized types may appear
in Instructions.

When ssa.InstantiateGenerics is on, calls to generic functions
with ground (non-parameterized) types are built as instantiations of the
generic function bodies. Otherwise, calls to generic functions are built
as a wrapper function that delegates to the generic function body.

The ChangeType instruction can now represent a coercion to or from a
parameterized type to an instance of the type.

*ssa.Const values may now represent the zero value of any type.

The build mode of go/analysis/passes/buildssa is again
ssa.BuilderMode(0) (i.e. ssa.InstantiateGenerics is off).

This change is a stack of already reviewed CLs.

Fixes golang/go#48525

Change-Id: Ib516eba43963674c804a63e3dcdae6d4116353c9
Reviewed-on: https://go-review.googlesource.com/c/tools/+/425496
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Zvonimir Pavlinovic <zpavlinovic@google.com>
Run-TryBot: Tim King <taking@google.com>
gopls-CI: kokoro <noreply+kokoro@google.com>
Reviewed-by: Alan Donovan <adonovan@google.com>
2022-11-18 18:55:10 +00:00
..
analysis go/ssa: build generic function bodies 2022-11-18 18:55:10 +00:00
ast all: use constant to avoid repeated definitions 2022-09-19 15:32:23 +00:00
buildutil all: fix a few function names on comments 2022-10-10 13:22:38 +00:00
callgraph go/ssa: build generic function bodies 2022-11-18 18:55:10 +00:00
cfg all: gofmt 2022-04-12 17:53:17 +00:00
expect all: gofmt 2022-04-12 17:53:17 +00:00
gccgoexportdata all: gofmt 2022-04-12 17:53:17 +00:00
gcexportdata internal/testenv: skip tests that need export data for std if 'go tool compile' does not exist 2022-11-17 20:46:33 +00:00
internal internal/gcimporter: moved from go/internal/gcimporter 2022-11-04 15:23:56 +00:00
loader all: gofmt 2022-04-12 17:53:17 +00:00
packages internal/testenv: skip tests that need export data for std if 'go tool compile' does not exist 2022-11-17 20:46:33 +00:00
pointer go/ssa: build generic function bodies 2022-11-18 18:55:10 +00:00
ssa go/ssa: build generic function bodies 2022-11-18 18:55:10 +00:00
types go/types/typeutil: break recursion through anonymous interfaces 2022-10-28 20:13:59 +00:00
vcs all: gofmt 2022-04-12 17:53:17 +00:00