]> Cypherpunks.ru repositories - gostls13.git/commit
cmd/compile: include typecheck information in export/import
authorKeith Randall <khr@golang.org>
Fri, 12 Mar 2021 20:57:39 +0000 (12:57 -0800)
committerKeith Randall <khr@golang.org>
Sat, 10 Apr 2021 14:58:18 +0000 (14:58 +0000)
commit1129a60f1c1e64147ca1133857c4571ce9b87a35
tree6ea37d4fb479f7009ccf43aacc07a547db7e7287
parent11f159456b1dba3ec499da916852dd188d1e04a7
cmd/compile: include typecheck information in export/import

Include type information on exported function bodies, so that the
importer does not have to re-typecheck the body. This involves
including type information in the encoded output, as well as
avoiding some of the opcode rewriting and other changes that the
old exporter did assuming there would be a re-typechecking pass.

This CL could be considered a cleanup, but is more important than that
because it is an enabling change for generics. Without this CL, we'd
have to upgrade the current typechecker to understand generics. With
this CL, the current typechecker can mostly go away in favor of the
types2 typechecker.

For now, inlining of functions that contain closures is turned off.
We will hopefully resolve this before freeze.

Object files are only 0.07% bigger.

Change-Id: I85c9da09f66bfdc910dc3e26abb2613a1831634d
Reviewed-on: https://go-review.googlesource.com/c/go/+/301291
Trust: Keith Randall <khr@golang.org>
Trust: Dan Scales <danscales@google.com>
Reviewed-by: Dan Scales <danscales@google.com>
src/cmd/compile/internal/escape/escape.go
src/cmd/compile/internal/inline/inl.go
src/cmd/compile/internal/typecheck/func.go
src/cmd/compile/internal/typecheck/iexport.go
src/cmd/compile/internal/typecheck/iimport.go
test/closure3.dir/main.go
test/inline.go