]> Cypherpunks.ru repositories - gostls13.git/commit
[dev.typeparams] cmd/compile/internal/inline: refactor mkinlcall
authorMatthew Dempsky <mdempsky@google.com>
Thu, 27 May 2021 09:47:04 +0000 (02:47 -0700)
committerMatthew Dempsky <mdempsky@google.com>
Thu, 27 May 2021 23:40:56 +0000 (23:40 +0000)
commit417955d151359629ca11be968e3056e6636b828e
tree8e9df45ec0602f0592639604563f36f01b86405f
parent88583a2a6639c72f2cb0143b0135f50fa6b379c0
[dev.typeparams] cmd/compile/internal/inline: refactor mkinlcall

This CL refactors mkinlcall by extracting the core InlinedCallExpr
construction code into a new "oldInline" function, and adds a new
"NewInline" hook point that can be overriden with a new inliner
implementation that only needs to worry about the details of
constructing the InlinedCallExpr.

It also moves the delayretvars optimization check into CanInline, so
it's performed just once per inlinable function rather than once for
each inlined call.

Finally, it skips printing the function body about to be inlined (and
updates the couple of regress tests that expected this output). We
already report the inline body as it was saved, and this diagnostic is
only applicable to the current inliner, which clones existing function
body instances. In the unified IR inliner, we'll directly construct
inline bodies from the serialized representation.

Change-Id: Ibdbe617da83c07665dcbda402cc8d4d4431dde2f
Reviewed-on: https://go-review.googlesource.com/c/go/+/323290
Trust: Matthew Dempsky <mdempsky@google.com>
Trust: Dan Scales <danscales@google.com>
Run-TryBot: Matthew Dempsky <mdempsky@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Dan Scales <danscales@google.com>
src/cmd/compile/internal/inline/inl.go
src/cmd/compile/internal/ir/func.go
src/cmd/compile/internal/typecheck/iexport.go
src/cmd/compile/internal/typecheck/iimport.go
test/fixedbugs/issue24651a.go
test/fixedbugs/issue24651b.go
test/inline_big.go