mirror of https://github.com/golang/go.git
[dev.typeparams] cmd/compile: get runtime stuff working
Remaining stuff from Dan's CL 335412 to get tests passing. - Removed PTRLIT case in node() that was added with the gcshape change. I don't think it is needed anymore. - Modified (*itab).init() to add an irrelevant pointer (the itab itself) for the '==' entry of interfaces with 'comparable'. That entry is not used, so we just want to avoid the error that the given type doesn't actually have an '==' method. Change-Id: I9b2d4c8342c0b2048d76e003d95023f4ccd559f5 Reviewed-on: https://go-review.googlesource.com/c/go/+/336149 Run-TryBot: Keith Randall <khr@golang.org> TryBot-Result: Go Bot <gobot@golang.org> Reviewed-by: Dan Scales <danscales@google.com> Trust: Dan Scales <danscales@google.com> Trust: Keith Randall <khr@golang.org>
This commit is contained in:
parent
4a97fe8c22
commit
e6a2cf233f
|
|
@ -1394,11 +1394,6 @@ func (subst *subster) node(n ir.Node) ir.Node {
|
||||||
// TODO: need to modify m.X? I don't think any downstream passes use it.
|
// TODO: need to modify m.X? I don't think any downstream passes use it.
|
||||||
m.SetType(subst.unshapifyTyp(m.Type()))
|
m.SetType(subst.unshapifyTyp(m.Type()))
|
||||||
|
|
||||||
case ir.OPTRLIT:
|
|
||||||
m := m.(*ir.AddrExpr)
|
|
||||||
// Walk uses the type of the argument of ptrlit. Also could be a shape type?
|
|
||||||
m.X.SetType(subst.unshapifyTyp(m.X.Type()))
|
|
||||||
|
|
||||||
case ir.OMETHEXPR:
|
case ir.OMETHEXPR:
|
||||||
se := m.(*ir.SelectorExpr)
|
se := m.(*ir.SelectorExpr)
|
||||||
se.X = ir.TypeNodeAt(se.X.Pos(), subst.unshapifyTyp(se.X.Type()))
|
se.X = ir.TypeNodeAt(se.X.Pos(), subst.unshapifyTyp(se.X.Type()))
|
||||||
|
|
|
||||||
|
|
@ -214,6 +214,16 @@ imethods:
|
||||||
if ipkg == "" {
|
if ipkg == "" {
|
||||||
ipkg = inter.pkgpath.name()
|
ipkg = inter.pkgpath.name()
|
||||||
}
|
}
|
||||||
|
if iname == "==" {
|
||||||
|
// Don't need '==' method right now (from comparable),
|
||||||
|
// just fill in with a random pointer for now.
|
||||||
|
if k == 0 {
|
||||||
|
fun0 = unsafe.Pointer(m)
|
||||||
|
} else {
|
||||||
|
methods[k] = unsafe.Pointer(m)
|
||||||
|
}
|
||||||
|
continue imethods
|
||||||
|
}
|
||||||
for ; j < nt; j++ {
|
for ; j < nt; j++ {
|
||||||
t := &xmhdr[j]
|
t := &xmhdr[j]
|
||||||
tname := typ.nameOff(t.name)
|
tname := typ.nameOff(t.name)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue