]> Cypherpunks.ru repositories - gostls13.git/commit
cmd/compile: use HaveInlineBody for unified IR
authorMatthew Dempsky <mdempsky@google.com>
Wed, 31 Aug 2022 20:48:06 +0000 (13:48 -0700)
committerGopher Robot <gobot@golang.org>
Wed, 31 Aug 2022 22:22:43 +0000 (22:22 +0000)
commite4b624eae5fa3c51b8ca808da29442d3e3aaef04
tree03c9b4a666c1adbdba80ce5ce2a894a46ada94e7
parent33a7e5a4b49fa04ce6f65b5b0645a44a0c93eaad
cmd/compile: use HaveInlineBody for unified IR

In go.dev/cl/419674 I added a mechanism to the inliner to allow
inlining to fail gracefully when a function body is missing, but I
missed we already have a mechanism for that: typecheck.HaveInlineBody.

This CL makes it overridable so that unified IR can plug in its
appropriate logic, like it does with the logic for building the
ir.InlinedCallExpr node.

While here, rename inline.NewInline to inline.InlineCall, because the
name "NewInline" is now a misnomer since we initialize it to oldInline
(now named oldInlineCall).

Change-Id: I4e65618d3725919f69e6f43cf409699d20fb797c
Reviewed-on: https://go-review.googlesource.com/c/go/+/427234
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: David Chase <drchase@google.com>
Run-TryBot: Matthew Dempsky <mdempsky@google.com>
Auto-Submit: Matthew Dempsky <mdempsky@google.com>
src/cmd/compile/internal/inline/inl.go
src/cmd/compile/internal/noder/reader.go
src/cmd/compile/internal/noder/unified.go
src/cmd/compile/internal/typecheck/iimport.go