aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/compile/internal/typecheck/iexport.go
diff options
context:
space:
mode:
authorMatthew Dempsky <mdempsky@google.com>2021-05-27 02:47:04 -0700
committerMatthew Dempsky <mdempsky@google.com>2021-05-27 23:40:56 +0000
commit417955d151359629ca11be968e3056e6636b828e (patch)
tree8e9df45ec0602f0592639604563f36f01b86405f /src/cmd/compile/internal/typecheck/iexport.go
parent88583a2a6639c72f2cb0143b0135f50fa6b379c0 (diff)
downloadgo-417955d151359629ca11be968e3056e6636b828e.tar.gz
go-417955d151359629ca11be968e3056e6636b828e.zip
[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>
Diffstat (limited to 'src/cmd/compile/internal/typecheck/iexport.go')
-rw-r--r--src/cmd/compile/internal/typecheck/iexport.go1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/cmd/compile/internal/typecheck/iexport.go b/src/cmd/compile/internal/typecheck/iexport.go
index e798ce5143..f49718d442 100644
--- a/src/cmd/compile/internal/typecheck/iexport.go
+++ b/src/cmd/compile/internal/typecheck/iexport.go
@@ -1313,6 +1313,7 @@ func (w *exportWriter) funcExt(n *ir.Name) {
}
if n.Func.Inl != nil {
w.uint64(1 + uint64(n.Func.Inl.Cost))
+ w.bool(n.Func.Inl.CanDelayResults)
if n.Func.ExportInline() || n.Type().HasTParam() {
w.p.doInline(n)
}