Body: inlcopylist(fn.Nbody.Slice()),
}
- // hack, TODO, check for better way to link method nodes back to the thing with the ->inl
- // this is so export can find the body of a method
- fn.Type.FuncType().Nname = asTypesNode(n)
-
if Debug.m > 1 {
fmt.Printf("%v: can inline %#v with cost %d as: %#v { %#v }\n", fn.Line(), n, inlineMaxBudget-visitor.budget, fn.Type, asNodes(n.Func.Inl.Body))
} else if Debug.m != 0 {
out = append(out, d)
}
- t := functype(nil, in, out)
- if f.Nname() != nil {
- // Link to name of original method function.
- t.SetNname(f.Nname())
- }
-
- return t
+ return functype(nil, in, out)
}
// methods returns the methods of the non-interface type t, sorted by name.
return
}
n.Type = t
- t.FuncType().Nname = asTypesNode(n.Func.Nname)
rcvr := t.Recv()
if rcvr != nil && n.Func.Shortname != nil {
m := addmethod(n, n.Func.Shortname, t, true, n.Func.Pragma&Nointerface != 0)
Results *Type // function results
Params *Type // function params
- Nname *Node
- pkg *Pkg
+ pkg *Pkg
// Argwid is the total width of the function receiver, params, and results.
// It gets calculated via a temporary TFUNCARGS type.
return t.Extra.(FuncArgs).T
}
-// Nname returns the associated function's nname.
-func (t *Type) Nname() *Node {
- switch t.Etype {
- case TFUNC:
- return t.Extra.(*Func).Nname
- }
- Fatalf("Type.Nname %v %v", t.Etype, t)
- return nil
-}
-
-// Nname sets the associated function's nname.
-func (t *Type) SetNname(n *Node) {
- switch t.Etype {
- case TFUNC:
- t.Extra.(*Func).Nname = n
- default:
- Fatalf("Type.SetNname %v %v", t.Etype, t)
- }
-}
-
// IsFuncArgStruct reports whether t is a struct representing function parameters.
func (t *Type) IsFuncArgStruct() bool {
return t.Etype == TSTRUCT && t.Extra.(*Struct).Funarg != FunargNone