return nil
}
-func methodname(n, recv *Node) *Node {
+func methodname(s *Sym, recv *Node) *Node {
star := false
if recv.Op == OIND {
star = true
recv = recv.Left
}
- return methodname0(n.Sym, star, recv.Sym)
+ return methodname0(s, star, recv.Sym)
}
func methodname0(s *Sym, star bool, tsym *Sym) *Node {
s1 := Pkglookup(s.Name+"·f", s.Pkg)
if !Ctxt.Flag_dynlink && s1.Def == nil {
s1.Def = newfuncname(s1)
- s1.Def.Func.Shortname = newname(s)
+ s1.Def.Func.Shortname = s
funcsyms = append(funcsyms, s1.Def)
}
s.Fsym = s1
}
s1 := funcsym(s)
s1.Def = newfuncname(s1)
- s1.Def.Func.Shortname = newname(s)
+ s1.Def.Func.Shortname = s
funcsyms = append(funcsyms, s1.Def)
}
} else {
// Receiver MethodName Signature
- f.Func.Shortname = newfuncname(name)
+ f.Func.Shortname = name
f.Func.Nname = methodname(f.Func.Shortname, t.Left.Right)
}
}
for _, n := range funcsyms {
- dsymptr(n.Sym, 0, n.Sym.Def.Func.Shortname.Sym, 0)
+ dsymptr(n.Sym, 0, n.Sym.Def.Func.Shortname, 0)
ggloblsym(n.Sym, int32(Widthptr), obj.DUPOK|obj.RODATA)
}
// Func holds Node fields used only with function-like nodes.
type Func struct {
- Shortname *Node
+ Shortname *Sym
Enter Nodes // for example, allocate and initialize memory for escaping parameters
Exit Nodes
Cvars Nodes // closure params
t.SetNname(n.Func.Nname)
rcvr := t.Recv()
if rcvr != nil && n.Func.Shortname != nil {
- addmethod(n.Func.Shortname.Sym, t, true, n.Func.Pragma&Nointerface != 0)
+ addmethod(n.Func.Shortname, t, true, n.Func.Pragma&Nointerface != 0)
}
}