diff options
author | Matthew Dempsky <mdempsky@google.com> | 2021-11-04 13:28:25 -0700 |
---|---|---|
committer | Matthew Dempsky <mdempsky@google.com> | 2021-11-05 07:00:05 +0000 |
commit | 6fefb7f9f3b632bdd0c3997ecc5b1096a5077cdf (patch) | |
tree | a9df5525815f168a767bf887f52ca28252cc4d1c /src/cmd/compile/internal/typecheck/crawler.go | |
parent | b68c02e2919aec347438a7ec6512b0d2accd163f (diff) | |
download | go-6fefb7f9f3b632bdd0c3997ecc5b1096a5077cdf.tar.gz go-6fefb7f9f3b632bdd0c3997ecc5b1096a5077cdf.zip |
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>
Diffstat (limited to 'src/cmd/compile/internal/typecheck/crawler.go')
-rw-r--r-- | src/cmd/compile/internal/typecheck/crawler.go | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/cmd/compile/internal/typecheck/crawler.go b/src/cmd/compile/internal/typecheck/crawler.go index ae2b3b1df4..ae6542d071 100644 --- a/src/cmd/compile/internal/typecheck/crawler.go +++ b/src/cmd/compile/internal/typecheck/crawler.go @@ -207,7 +207,7 @@ func (p *crawler) markInlBody(n *ir.Name) { if fn == nil { base.Fatalf("markInlBody: missing Func on %v", n) } - if fn.Inl == nil { + if !HaveInlineBody(fn) { return } |