fn := NewNameAt(n.Selection.Pos, MethodSym(n.X.Type(), n.Sel))
fn.Class = PFUNC
fn.SetType(n.Type())
+ if n.Selection.Nname != nil {
+ // TODO(austin): Nname is nil for interface method
+ // expressions (I.M), so we can't attach a Func to
+ // those here. reflectdata.methodWrapper generates the
+ // Func.
+ fn.Func = n.Selection.Nname.(*Name).Func
+ }
return fn
}
pragma PragmaFlag // int16
flags bitset16
sym *types.Sym
- Func *Func
+ Func *Func // TODO(austin): nil for I.M, eqFor, hashfor, and hashmem
Offset_ int64
val constant.Value
Opt interface{} // for use by escape analysis
sym = TypeSymPrefix(".hash", t)
}
+ // TODO(austin): This creates an ir.Name with a nil Func.
n := typecheck.NewName(sym)
ir.MarkFunc(n)
n.SetType(types.NewSignature(types.NoPkg, nil, nil, []*types.Field{
func hashmem(t *types.Type) ir.Node {
sym := ir.Pkgs.Runtime.Lookup("memhash")
+ // TODO(austin): This creates an ir.Name with a nil Func.
n := typecheck.NewName(sym)
ir.MarkFunc(n)
n.SetType(types.NewSignature(types.NoPkg, nil, nil, []*types.Field{
typecheck.NewFuncParams(method.Type.Params(), true),
typecheck.NewFuncParams(method.Type.Results(), false))
+ // TODO(austin): SelectorExpr may have created one or more
+ // ir.Names for these already with a nil Func field. We should
+ // consolidate these and always attach a Func to the Name.
fn := typecheck.DeclFunc(newnam, tfn)
fn.SetDupok(true)
n := ir.NewNameAt(old.Pos(), old.Sym())
n.Class = old.Class
n.SetType(types.SubstAny(old.Type(), &types_))
+ n.Func = old.Func
if len(types_) > 0 {
base.Fatalf("SubstArgTypes: too many argument types")
}
return n, true
case types.ASPECIAL:
sym := reflectdata.TypeSymPrefix(".eq", t)
+ // TODO(austin): This creates an ir.Name with a nil Func.
n := typecheck.NewName(sym)
ir.MarkFunc(n)
n.SetType(types.NewSignature(types.NoPkg, nil, nil, []*types.Field{