mirror of
https://github.com/golang/go
synced 2024-09-15 22:20:06 +00:00
cmd/compile: remove reflectdata.{TypePtr,ITabAddr} wrappers
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>
This commit is contained in:
parent
f123f5c768
commit
03631f027e
|
@ -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.
|
||||
|
|
|
@ -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.
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue