aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/compile/internal/ir
diff options
context:
space:
mode:
authorMatthew Dempsky <mdempsky@google.com>2021-07-03 11:22:26 -0700
committerMatthew Dempsky <mdempsky@google.com>2021-07-04 00:19:26 +0000
commit899b158ee9e99642bdbea2008d7cc70382db6545 (patch)
tree3fb700ff85fa9232bef96591c32adad77b6181e6 /src/cmd/compile/internal/ir
parentea5369bac041e7a78e198f4412350cfd923215aa (diff)
downloadgo-899b158ee9e99642bdbea2008d7cc70382db6545.tar.gz
go-899b158ee9e99642bdbea2008d7cc70382db6545.zip
[dev.typeparams] cmd/compile: set Func.ClosureCalled in escape analysis
The Func.ClosureCalled flag is an optimization used by escape analysis to detect closures that were directly called, so we know we have visibility of the result flows. It's not needed by any other phases of the compiler, so we might as well calculate it within escape analysis too. This saves some trouble during IR construction and trying to maintain the ClosureCalled flag through inlining and copying. Passes toolstash -cmp. Change-Id: Ic53cecb7ac439745c0dfba2cd202b9cc40f1e47c Reviewed-on: https://go-review.googlesource.com/c/go/+/332691 Run-TryBot: Matthew Dempsky <mdempsky@google.com> Trust: Matthew Dempsky <mdempsky@google.com> TryBot-Result: Go Bot <gobot@golang.org> Reviewed-by: Cuong Manh Le <cuong.manhle.vn@gmail.com>
Diffstat (limited to 'src/cmd/compile/internal/ir')
-rw-r--r--src/cmd/compile/internal/ir/func.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/cmd/compile/internal/ir/func.go b/src/cmd/compile/internal/ir/func.go
index 3b9e36d4c5..269b6f14ec 100644
--- a/src/cmd/compile/internal/ir/func.go
+++ b/src/cmd/compile/internal/ir/func.go
@@ -202,7 +202,7 @@ const (
funcExportInline // include inline body in export data
funcInstrumentBody // add race/msan instrumentation during SSA construction
funcOpenCodedDeferDisallowed // can't do open-coded defers
- funcClosureCalled // closure is only immediately called
+ funcClosureCalled // closure is only immediately called; used by escape analysis
)
type SymAndPos struct {