// ONAME
Name *Name
- Ntype *Node
Defn *Node // ONAME: initializing assignment; OLABEL: labeled statement
Pack *Node // real package for import . names
Curfn *Node // function for local variables
Paramfld *Type // TFIELD for this PPARAM; also for ODOT, curfn
-
- // ONAME func param with PHEAP
- Outerexpr *Node // expression copied into closure for variable
- Stackparam *Node // OPARAM node referring to stack copy of param
- Alloc *Node // allocation call
-
- // ONAME closure param with PPARAMREF
- Outer *Node // outer PPARAMREF in nested closure
- Closure *Node // ONAME/PHEAP <-> ONAME/PPARAMREF
- Top int // top context (Ecall, Eproc, etc)
+ Alloc *Node // allocation call
+ *Param
// OPACK
Pkg *Pkg
Needzero bool // if it contains pointers, needs to be zeroed on function entry
}
+type Param struct {
+ Ntype *Node
+
+ // ONAME func param with PHEAP
+ Outerexpr *Node // expression copied into closure for variable
+ Stackparam *Node // OPARAM node referring to stack copy of param
+
+ // ONAME closure param with PPARAMREF
+ Outer *Node // outer PPARAMREF in nested closure
+ Closure *Node // ONAME/PHEAP <-> ONAME/PPARAMREF
+ Top int // top context (Ecall, Eproc, etc)
+}
+
// Func holds Node fields used only with function-like nodes.
type Func struct {
Shortname *Node
var l *Node
for l = n.Left; l != r; l = l.Left {
l.Addrtaken = true
- if l.Closure != nil {
+ if l.Param != nil && l.Closure != nil {
l.Closure.Addrtaken = true
}
}
Fatal("found non-orig name node %v", l)
}
l.Addrtaken = true
- if l.Closure != nil {
+ if l.Param != nil && l.Closure != nil {
l.Closure.Addrtaken = true
}
defaultlit(&n.Left, nil)
var l *Node
for l = n; l != r; l = l.Left {
l.Assigned = true
- if l.Closure != nil {
+ if l.Param != nil && l.Closure != nil {
l.Closure.Assigned = true
}
}
l.Assigned = true
- if l.Closure != nil {
+ if l.Param != nil && l.Closure != nil {
l.Closure.Assigned = true
}
}