mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
[dev.typeparams] cmd/compile: remove CallExpr.PreserveClosure
This flag is only needed to prevent the directClosureCall optimization in walkCall, when called for walkGoDefer. But walkGoDefer don't need to call walkCall: at this point in the compile, the call expression isn't a real call anymore. Instead, we just need to walkExpr on the function expression. Change-Id: I8a5176cfe1bff53700cbd21ed1b479ebd9a839ad Reviewed-on: https://go-review.googlesource.com/c/go/+/330271 Run-TryBot: Matthew Dempsky <mdempsky@google.com> TryBot-Result: Go Bot <gobot@golang.org> Reviewed-by: Cuong Manh Le <cuong.manhle.vn@gmail.com> Trust: Matthew Dempsky <mdempsky@google.com>
This commit is contained in:
parent
e59a19cceb
commit
1a445dab66
4 changed files with 10 additions and 21 deletions
|
|
@ -204,7 +204,9 @@ func walkGoDefer(n *ir.GoDeferStmt) ir.Node {
|
|||
}
|
||||
|
||||
var init ir.Nodes
|
||||
n.Call = walkExpr(n.Call, &init)
|
||||
|
||||
call := n.Call.(*ir.CallExpr)
|
||||
call.X = walkExpr(call.X, &init)
|
||||
|
||||
if len(init) > 0 {
|
||||
init.Append(n)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue