mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
cmd/compile: remove Node.Ntest, Node.Stkdelta
$ sizeof -p cmd/compile/internal/gc Node Node 272 $ Change-Id: I3d9b67eebfc0be0a4b9768d3de3dc76300abd89c Reviewed-on: https://go-review.googlesource.com/10521 Reviewed-by: Ian Lance Taylor <iant@golang.org> Reviewed-by: Josh Bleecher Snyder <josharian@gmail.com>
This commit is contained in:
parent
ffef180f82
commit
66be1481df
20 changed files with 207 additions and 269 deletions
|
|
@ -134,7 +134,6 @@ func (v *bottomUpVisitor) visitcode(n *Node, min uint32) uint32 {
|
|||
min = v.visitcode(n.Left, min)
|
||||
min = v.visitcode(n.Right, min)
|
||||
min = v.visitcodelist(n.List, min)
|
||||
min = v.visitcode(n.Ntest, min)
|
||||
min = v.visitcodelist(n.Nbody, min)
|
||||
min = v.visitcodelist(n.Rlist, min)
|
||||
|
||||
|
|
@ -543,7 +542,6 @@ func escloopdepth(e *EscState, n *Node) {
|
|||
escloopdepth(e, n.Left)
|
||||
escloopdepth(e, n.Right)
|
||||
escloopdepthlist(e, n.List)
|
||||
escloopdepth(e, n.Ntest)
|
||||
escloopdepthlist(e, n.Nbody)
|
||||
escloopdepthlist(e, n.Rlist)
|
||||
}
|
||||
|
|
@ -572,7 +570,7 @@ func esc(e *EscState, n *Node, up *Node) {
|
|||
// process type switch as declaration.
|
||||
// must happen before processing of switch body,
|
||||
// so before recursion.
|
||||
if n.Op == OSWITCH && n.Ntest != nil && n.Ntest.Op == OTYPESW {
|
||||
if n.Op == OSWITCH && n.Left != nil && n.Left.Op == OTYPESW {
|
||||
for ll := n.List; ll != nil; ll = ll.Next { // cases
|
||||
|
||||
// ll->n->nname is the variable per case
|
||||
|
|
@ -597,7 +595,6 @@ func esc(e *EscState, n *Node, up *Node) {
|
|||
|
||||
esc(e, n.Left, n)
|
||||
esc(e, n.Right, n)
|
||||
esc(e, n.Ntest, n)
|
||||
esclist(e, n.Nbody, n)
|
||||
esclist(e, n.List, n)
|
||||
esclist(e, n.Rlist, n)
|
||||
|
|
@ -646,12 +643,12 @@ func esc(e *EscState, n *Node, up *Node) {
|
|||
}
|
||||
|
||||
case OSWITCH:
|
||||
if n.Ntest != nil && n.Ntest.Op == OTYPESW {
|
||||
for ll := n.List; ll != nil; ll = ll.Next { // cases
|
||||
|
||||
if n.Left != nil && n.Left.Op == OTYPESW {
|
||||
for ll := n.List; ll != nil; ll = ll.Next {
|
||||
// cases
|
||||
// ntest->right is the argument of the .(type),
|
||||
// ll->n->nname is the variable per case
|
||||
escassign(e, ll.N.Nname, n.Ntest.Right)
|
||||
escassign(e, ll.N.Nname, n.Left.Right)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue