s.Block = block
s.Lastlineno = int32(parserline())
s.Def = n
- n.Vargen = int32(gen)
+ n.Name.Vargen = int32(gen)
n.Funcdepth = Funcdepth
n.Class = uint8(ctxt)
// walkdef will check s->def again once
// all the input source has been processed.
n = newname(s)
-
n.Op = ONONAME
- n.Iota = iota_ // save current iota value in const declarations
+ n.Name.Iota = iota_ // save current iota value in const declarations
}
if Curfn != nil && n.Funcdepth > 0 && n.Funcdepth != Funcdepth && n.Op == ONAME {
declare(n.Left, PPARAM)
if dclcontext == PAUTO {
vargen++
- n.Left.Vargen = int32(vargen)
+ n.Left.Name.Vargen = int32(vargen)
}
}
}
declare(n.Left, PPARAM)
if dclcontext == PAUTO {
vargen++
- n.Left.Vargen = int32(vargen)
+ n.Left.Name.Vargen = int32(vargen)
}
}
}
declare(n.Left, PPARAMOUT)
if dclcontext == PAUTO {
i++
- n.Left.Vargen = int32(i)
+ n.Left.Name.Vargen = int32(i)
}
}
}
if src.Esc&EscMask != EscReturn {
src.Esc = EscReturn | src.Esc&EscContentEscapes
}
- src.Esc = escNoteOutputParamFlow(src.Esc, dst.Vargen, level)
+ src.Esc = escNoteOutputParamFlow(src.Esc, dst.Name.Vargen, level)
goto recurse
}
fmt.Fprintf(&buf, " a(%v)", n.Addable)
}
- if c == 0 && n.Vargen != 0 {
- fmt.Fprintf(&buf, " g(%d)", n.Vargen)
+ if c == 0 && n.Name != nil && n.Name.Vargen != 0 {
+ fmt.Fprintf(&buf, " g(%d)", n.Name.Vargen)
}
if n.Lineno != 0 {
if (fmtmode == FExp || fmtmode == FErr) && n.Sym != nil && n.Sym.Name[0] == '~' && n.Sym.Name[1] == 'b' {
return "_"
}
- if fmtmode == FExp && n.Sym != nil && !isblank(n) && n.Vargen > 0 {
- return fmt.Sprintf("%v·%d", n.Sym, n.Vargen)
+ if fmtmode == FExp && n.Sym != nil && !isblank(n) && n.Name.Vargen > 0 {
+ return fmt.Sprintf("%v·%d", n.Sym, n.Name.Vargen)
}
// Special case: explicit name of func (*T) method(...) is turned into pkg.(*T).method,
}
if n.Sym != nil && n.Op != ONAME {
- fmt.Fprintf(&buf, " %v G%d", n.Sym, n.Vargen)
+ fmt.Fprintf(&buf, " %v G%d", n.Sym, n.Name.Vargen)
}
if n.Type != nil {
// so that all the copies of this const definition
// don't have the same iota value.
m = Nod(OXXX, nil, nil)
-
*m = *n
- m.Iota = iota_
if lineno != 0 {
m.Lineno = lineno
}
+ m.Name = new(Name)
+ *m.Name = *n.Name
+ m.Name.Iota = iota_
break
}
fallthrough
}
switch n.Op {
case ONAME:
- fmt.Printf("%v %v G%d %v width=%d\n", Oconv(int(n.Op), 0), n.Sym, n.Vargen, n.Type, w)
+ fmt.Printf("%v %v G%d %v width=%d\n", Oconv(int(n.Op), 0), n.Sym, n.Name.Vargen, n.Type, w)
case OTYPE:
fmt.Printf("%v %v width=%d\n", Oconv(int(n.Op), 0), n.Type, w)
Xoffset int64
- Vargen int32 // unique name for OTYPE/ONAME within a function. Function outputs are numbered starting at one.
Lineno int32
- Iota int32
Walkgen uint32
Funcdepth int32
Inlvar *Node // ONAME substitute while inlining
Defn *Node // initializing assignment
Decldepth int32 // declaration loop depth, increased for every loop or label
+ Vargen int32 // unique name for OTYPE/ONAME within a function. Function outputs are numbered starting at one.
+ Iota int32 // value if this name is iota
Method bool // OCALLMETH name
Readonly bool
Captured bool // is the variable captured by a closure
if r != nil {
if r.Op != OIOTA {
n = r
- } else if n.Iota >= 0 {
- n = Nodintconst(int64(n.Iota))
+ } else if n.Name.Iota >= 0 {
+ n = Nodintconst(int64(n.Name.Iota))
}
}
}
t = n.Type
t.Sym = n.Sym
t.Local = n.Local
- t.Vargen = n.Vargen
+ if n.Name != nil {
+ t.Vargen = n.Name.Vargen
+ }
t.Siggen = 0
t.Method = nil
t.Xmethod = nil