]> Cypherpunks repositories - gostls13.git/commit
cmd/compile: gracefully fallback when inline bodies are missing
authorMatthew Dempsky <mdempsky@google.com>
Thu, 4 Nov 2021 20:28:25 +0000 (13:28 -0700)
committerMatthew Dempsky <mdempsky@google.com>
Fri, 5 Nov 2021 07:00:05 +0000 (07:00 +0000)
commit6fefb7f9f3b632bdd0c3997ecc5b1096a5077cdf
treea9df5525815f168a767bf887f52ca28252cc4d1c
parentb68c02e2919aec347438a7ec6512b0d2accd163f
cmd/compile: gracefully fallback when inline bodies are missing

Currently, we rely on a "crawling" step during export to identify
function and method bodies that need to be exported or re-exported so
we can trim out unnecessary ones and reduce build artifact sizes. To
catch cases where we expect a function to be inlinable but we failed
to export its body, we made this condition a fatal compiler error.

However, with generics, it's much harder to perfectly identify all
function bodies that need to be exported; and several attempts at
tweaking the algorithm have resulted in still having failure cases.
So for now, this CL changes a missing inline body into a graceful
failure instead.

Change-Id: I04b0872d0dcaae9c3de473e92ce584e4ec6fd782
Reviewed-on: https://go-review.googlesource.com/c/go/+/361403
Trust: Matthew Dempsky <mdempsky@google.com>
Trust: Dan Scales <danscales@google.com>
Run-TryBot: Matthew Dempsky <mdempsky@google.com>
Reviewed-by: Dan Scales <danscales@google.com>
src/cmd/compile/internal/inline/inl.go
src/cmd/compile/internal/typecheck/crawler.go
src/cmd/compile/internal/typecheck/iimport.go