cmd/compile: move Node.Typecheck to flags

Change-Id: Id5aa4a1499068bf2d3497b21d794f970b7e47fdf
Reviewed-on: https://go-review.googlesource.com/41795
Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
This commit is contained in:
Josh Bleecher Snyder 2017-04-25 18:02:43 -07:00
parent e2560ace3c
commit 502a03ffcf
13 changed files with 67 additions and 64 deletions

View file

@ -965,7 +965,7 @@ func assignconvfn(n *Node, t *types.Type, context func() string) *Node {
if n.Op == ONAME || n.Op == OLITERAL {
r := nod(OCONVNOP, n, nil)
r.Type = types.Types[TBOOL]
r.Typecheck = 1
r.SetTypecheck(1)
r.SetImplicit(true)
n = r
}
@ -986,7 +986,7 @@ func assignconvfn(n *Node, t *types.Type, context func() string) *Node {
r := nod(op, n, nil)
r.Type = t
r.Typecheck = 1
r.SetTypecheck(1)
r.SetImplicit(true)
r.Orig = n.Orig
return r
@ -1965,7 +1965,7 @@ func addinit(n *Node, init []*Node) *Node {
// Introduce OCONVNOP to hold init list.
n = nod(OCONVNOP, n, nil)
n.Type = n.Left.Type
n.Typecheck = 1
n.SetTypecheck(1)
}
n.Ninit.Prepend(init...)
@ -2029,7 +2029,7 @@ func checknil(x *Node, init *Nodes) {
}
n := nod(OCHECKNIL, x, nil)
n.Typecheck = 1
n.SetTypecheck(1)
init.Append(n)
}
@ -2061,7 +2061,7 @@ func isdirectiface(t *types.Type) bool {
func itabType(itab *Node) *Node {
typ := nodSym(ODOTPTR, itab, nil)
typ.Type = types.NewPtr(types.Types[TUINT8])
typ.Typecheck = 1
typ.SetTypecheck(1)
typ.Xoffset = int64(Widthptr) // offset of _type in runtime.itab
typ.SetBounded(true) // guaranteed not to fault
return typ
@ -2074,14 +2074,14 @@ func ifaceData(n *Node, t *types.Type) *Node {
ptr := nodSym(OIDATA, n, nil)
if isdirectiface(t) {
ptr.Type = t
ptr.Typecheck = 1
ptr.SetTypecheck(1)
return ptr
}
ptr.Type = types.NewPtr(t)
ptr.SetBounded(true)
ptr.Typecheck = 1
ptr.SetTypecheck(1)
ind := nod(OIND, ptr, nil)
ind.Type = t
ind.Typecheck = 1
ind.SetTypecheck(1)
return ind
}