]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/compile: remove reflectdata.{TypePtr,ITabAddr} wrappers
authorMatthew Dempsky <mdempsky@google.com>
Fri, 11 Aug 2023 21:35:23 +0000 (14:35 -0700)
committerGopher Robot <gobot@golang.org>
Mon, 14 Aug 2023 18:39:22 +0000 (18:39 +0000)
Remove these in favor of the explicit *At variants that take a
src.XPos.

Change-Id: I2c095b75e43b58fe31e3e1b15c811a66ac5a0f83
Reviewed-on: https://go-review.googlesource.com/c/go/+/518956
Reviewed-by: Cuong Manh Le <cuong.manhle.vn@gmail.com>
Reviewed-by: Than McIntosh <thanm@google.com>
Run-TryBot: Matthew Dempsky <mdempsky@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Auto-Submit: Matthew Dempsky <mdempsky@google.com>

src/cmd/compile/internal/reflectdata/reflect.go
src/cmd/compile/internal/staticinit/sched.go
src/cmd/compile/internal/walk/assign.go
src/cmd/compile/internal/walk/builtin.go
src/cmd/compile/internal/walk/expr.go

index 728976f48e9c436f6c89bfb6aa741a87a670c971..2e5301c82348fe95907bcbadea39baa591f58b91 100644 (file)
@@ -839,11 +839,6 @@ func TypeLinksym(t *types.Type) *obj.LSym {
        return lsym
 }
 
-// Deprecated: Use TypePtrAt instead.
-func TypePtr(t *types.Type) *ir.AddrExpr {
-       return TypePtrAt(base.Pos, t)
-}
-
 // TypePtrAt returns an expression that evaluates to the
 // *runtime._type value for t.
 func TypePtrAt(pos src.XPos, t *types.Type) *ir.AddrExpr {
@@ -867,11 +862,6 @@ func ITabLsym(typ, iface *types.Type) *obj.LSym {
        return lsym
 }
 
-// Deprecated: Use ITabAddrAt instead.
-func ITabAddr(typ, iface *types.Type) *ir.AddrExpr {
-       return ITabAddrAt(base.Pos, typ, iface)
-}
-
 // ITabAddrAt returns an expression that evaluates to the
 // *runtime.itab value for concrete type typ implementing interface
 // iface.
index ca70591cd9f82e496ca429d98df8b00f09241978..b1c91089b94631921f0b558e59d6f398ca7b41a1 100644 (file)
@@ -377,9 +377,9 @@ func (s *Schedule) StaticAssign(l *ir.Name, loff int64, r ir.Node, typ *types.Ty
 
                var itab *ir.AddrExpr
                if typ.IsEmptyInterface() {
-                       itab = reflectdata.TypePtr(val.Type())
+                       itab = reflectdata.TypePtrAt(base.Pos, val.Type())
                } else {
-                       itab = reflectdata.ITabAddr(val.Type(), typ)
+                       itab = reflectdata.ITabAddrAt(base.Pos, val.Type(), typ)
                }
 
                // Create a copy of l to modify while we emit data.
index 4207b487a7eb4914514fe164617b2a0088536257..5672a6d982e8d67adbbb0166808ffa5ba249b49f 100644 (file)
@@ -518,7 +518,7 @@ func appendSlice(n *ir.CallExpr, init *ir.Nodes) ir.Node {
        fn = typecheck.SubstArgTypes(fn, elemtype, elemtype)
 
        // else { s = growslice(oldPtr, newLen, oldCap, num, T) }
-       call := mkcall1(fn, s.Type(), nif.PtrInit(), oldPtr, newLen, oldCap, num, reflectdata.TypePtr(elemtype))
+       call := mkcall1(fn, s.Type(), nif.PtrInit(), oldPtr, newLen, oldCap, num, reflectdata.TypePtrAt(base.Pos, elemtype))
        nif.Else = []ir.Node{ir.NewAssignStmt(base.Pos, s, call)}
 
        nodes.Append(nif)
@@ -706,7 +706,7 @@ func extendSlice(n *ir.CallExpr, init *ir.Nodes) ir.Node {
                        nn,
                        ir.NewUnaryExpr(base.Pos, ir.OCAP, s),
                        l2,
-                       reflectdata.TypePtr(elemtype))),
+                       reflectdata.TypePtrAt(base.Pos, elemtype))),
        }
 
        nodes = append(nodes, nif)
index 0bb501825071df58476eaa3d2d47949ea8892d74..c81cd0b3fadaed1f323d7ed1deb25dfad41cde8c 100644 (file)
@@ -111,7 +111,7 @@ func walkAppend(n *ir.CallExpr, init *ir.Nodes, dst ir.Node) ir.Node {
                        newLen,
                        ir.NewUnaryExpr(base.Pos, ir.OCAP, s),
                        num,
-                       reflectdata.TypePtr(s.Type().Elem()))),
+                       reflectdata.TypePtrAt(base.Pos, s.Type().Elem()))),
        }
 
        l = append(l, nif)
index 909e7d624eee6f46d0d784cea2480c8deafda46c..2d2e47d9560b190fe7f7bd82538edd01176afd7b 100644 (file)
@@ -714,7 +714,7 @@ func walkDotType(n *ir.TypeAssertExpr, init *ir.Nodes) ir.Node {
        n.X = walkExpr(n.X, init)
        // Set up interface type addresses for back end.
        if !n.Type().IsInterface() && !n.X.Type().IsEmptyInterface() {
-               n.ITab = reflectdata.ITabAddr(n.Type(), n.X.Type())
+               n.ITab = reflectdata.ITabAddrAt(base.Pos, n.Type(), n.X.Type())
        }
        return n
 }