* is being declared to have uncompiled type t.
* return the ODCLTYPE node to use.
*/
-func typedcl1(n *Node, t *Node, local int) *Node {
+func typedcl1(n *Node, t *Node, local bool) *Node {
n.Ntype = t
- n.Local = uint8(local)
+ n.Local = local
return Nod(ODCLTYPE, n, nil)
}
}
}
- if local && pa.Local == 0 {
+ if local && !pa.Local {
// defining method on non-local type.
Yyerror("cannot define new methods on non-local type %v", Tconv(pa, 0))
Siggen uint8
Funarg uint8 // on TSTRUCT and TFIELD
Copyany uint8
- Local uint8 // created in this file
+ Local bool // created in this file
Deferwidth uint8
Broke uint8 // broken type definition.
Isddd bool // TFIELD is ... argument
var thunk int32
-var Funcdepth int
+var Funcdepth int32
var typecheckok int
typedcl:
typedclname ntype
{
- $$ = typedcl1($1, $2, 1);
+ $$ = typedcl1($1, $2, true);
}
simple_stmt:
}
// named types from other files are defined only by those files
- if tbase.Sym != nil && tbase.Local == 0 {
+ if tbase.Sym != nil && !tbase.Local {
return s
}
if isforw[tbase.Etype] {
sudog.List = list(sudog.List, Nod(ODCLFIELD, newname(Lookup("waitlink")), typenod(Ptrto(Types[TUINT8]))))
typecheck(&sudog, Etype)
sudog.Type.Noalg = 1
- sudog.Type.Local = 1
+ sudog.Type.Local = true
scase := Nod(OTSTRUCT, nil, nil)
scase.List = list(scase.List, Nod(ODCLFIELD, newname(Lookup("elem")), typenod(Ptrto(Types[TUINT8]))))
scase.List = list(scase.List, Nod(ODCLFIELD, newname(Lookup("releasetime")), typenod(Types[TUINT64])))
typecheck(&scase, Etype)
scase.Type.Noalg = 1
- scase.Type.Local = 1
+ scase.Type.Local = true
sel := Nod(OTSTRUCT, nil, nil)
sel.List = list(sel.List, Nod(ODCLFIELD, newname(Lookup("tcase")), typenod(Types[TUINT16])))
sel.List = list(sel.List, Nod(ODCLFIELD, newname(Lookup("pollorderarr")), arr))
typecheck(&sel, Etype)
sel.Type.Noalg = 1
- sel.Type.Local = 1
+ sel.Type.Local = true
return sel.Type
}
// Set inl_nonlocal to whether we are calling a method on a
// type defined in a different package. Checked in inlvar.
- if methodrcvr.Local == 0 {
+ if !methodrcvr.Local {
inl_nonlocal = 1
}
Nowritebarrier bool // emit compiler error instead of write barrier
Walkdef uint8
Typecheck uint8
- Local uint8
+ Local bool
Dodata uint8
Initorder uint8
Used bool
Isddd bool // is the argument variadic
Readonly bool
Implicit bool
- Addrtaken bool // address taken, even if not moved to heap
- Assigned bool // is the variable ever assigned to
- Captured bool // is the variable captured by a closure
- Byval bool // is the variable captured by value or by reference
- Dupok bool // duplicate definitions ok (for func)
- Wrapper bool // is method wrapper (for func)
- Reslice bool // this is a reslice x = x[0:y] or x = append(x, ...)
- Likely int8 // likeliness of if statement
- Hasbreak bool // has break statement
- Needzero bool // if it contains pointers, needs to be zeroed on function entry
- Needctxt bool // function uses context register (has closure variables)
- Esc uint // EscXXX
- Funcdepth int
+ Addrtaken bool // address taken, even if not moved to heap
+ Assigned bool // is the variable ever assigned to
+ Captured bool // is the variable captured by a closure
+ Byval bool // is the variable captured by value or by reference
+ Dupok bool // duplicate definitions ok (for func)
+ Wrapper bool // is method wrapper (for func)
+ Reslice bool // this is a reslice x = x[0:y] or x = append(x, ...)
+ Likely int8 // likeliness of if statement
+ Hasbreak bool // has break statement
+ Needzero bool // if it contains pointers, needs to be zeroed on function entry
+ Needctxt bool // function uses context register (has closure variables)
+ Esc uint8 // EscXXX
+ Funcdepth int32
// most nodes
Type *Type
* package all the arguments that match a ... T parameter into a []T.
*/
func mkdotargslice(lr0 *NodeList, nn *NodeList, l *Type, fp int, init **NodeList, ddd *Node) *NodeList {
- esc := EscUnknown
+ esc := uint8(EscUnknown)
if ddd != nil {
- esc = int(ddd.Esc)
+ esc = ddd.Esc
}
tslice := typ(TARRAY)
n.Alloc = ddd.Alloc // temporary to use
}
n.List = lr0
- n.Esc = uint(esc)
+ n.Esc = esc
typecheck(&n, Erv)
if n.Type == nil {
Fatal("mkdotargslice: typecheck failed")
yyDollar = yyS[yypt-2 : yypt+1]
//line go.y:406
{
- yyVAL.node = typedcl1(yyDollar[1].node, yyDollar[2].node, 1)
+ yyVAL.node = typedcl1(yyDollar[1].node, yyDollar[2].node, true)
}
case 49:
yyDollar = yyS[yypt-1 : yypt+1]