]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/compile: remove unnecessary code in keepAliveAt
authorCuong Manh Le <cuong.manhle.vn@gmail.com>
Wed, 21 Jan 2026 08:20:27 +0000 (15:20 +0700)
committerGopher Robot <gobot@golang.org>
Thu, 22 Jan 2026 15:30:22 +0000 (07:30 -0800)
TypeWord and SrcRType are only needed for interface expression
conversion. Since CL 725180, the kept alive nodes are passed directly to
runtime.KeepAlive, so there's no interface conversion anymore.

Change-Id: I37ad8016bf76a1bf8ba36efea043fc71341b33c7
Reviewed-on: https://go-review.googlesource.com/c/go/+/737840
Auto-Submit: Cuong Manh Le <cuong.manhle.vn@gmail.com>
Reviewed-by: Keith Randall <khr@golang.org>
Reviewed-by: Keith Randall <khr@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Junyang Shao <shaojunyang@google.com>
src/cmd/compile/internal/bloop/bloop.go

index f2111cf95272a8a1d41aa1048359cb1c3d3cc12a..f65454871e2b3a34de8ab40bf5cca3776f0f83a7 100644 (file)
@@ -39,7 +39,6 @@ package bloop
 import (
        "cmd/compile/internal/base"
        "cmd/compile/internal/ir"
-       "cmd/compile/internal/reflectdata"
        "cmd/compile/internal/typecheck"
        "cmd/compile/internal/types"
        "cmd/internal/src"
@@ -117,11 +116,6 @@ func keepAliveAt(ns ir.Nodes, curNode ir.Node) ir.Node {
                        base.FatalfAt(n.Pos(), "keepAliveAt: node %v is not addressable", n)
                }
                arg := ir.NewConvExpr(pos, ir.OCONV, types.Types[types.TUNSAFEPTR], typecheck.NodAddr(n))
-               if !n.Type().IsInterface() {
-                       srcRType0 := reflectdata.TypePtrAt(pos, n.Type())
-                       arg.TypeWord = srcRType0
-                       arg.SrcRType = srcRType0
-               }
                callExpr := typecheck.Call(pos, typecheck.LookupRuntime("KeepAlive"), ir.Nodes{arg}, false).(*ir.CallExpr)
                callExpr.IsCompilerVarLive = true
                callExpr.NoInline = true