Commit 7e8e9abe authored by Josh Bleecher Snyder's avatar Josh Bleecher Snyder

cmd/compile: reduce stutter

This is follow-up 1 of 3 to CL 20959.

Passes toolstash -cmp.

Change-Id: I9bddf7d88333fa4755e03ff8a034a35bd01b7855
Reviewed-on: https://go-review.googlesource.com/21052
Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com>
Reviewed-by: default avatarBrad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
parent 694eadcc
...@@ -457,9 +457,7 @@ func walkclosure(func_ *Node, init *Nodes) *Node { ...@@ -457,9 +457,7 @@ func walkclosure(func_ *Node, init *Nodes) *Node {
delete(prealloc, func_) delete(prealloc, func_)
} }
clos = walkexpr(clos, init) return walkexpr(clos, init)
return clos
} }
func typecheckpartialcall(fn *Node, sym *Sym) { func typecheckpartialcall(fn *Node, sym *Sym) {
...@@ -662,7 +660,5 @@ func walkpartialcall(n *Node, init *Nodes) *Node { ...@@ -662,7 +660,5 @@ func walkpartialcall(n *Node, init *Nodes) *Node {
delete(prealloc, n) delete(prealloc, n)
} }
clos = walkexpr(clos, init) return walkexpr(clos, init)
return clos
} }
...@@ -143,8 +143,7 @@ func convlit1(n *Node, t *Type, explicit bool) *Node { ...@@ -143,8 +143,7 @@ func convlit1(n *Node, t *Type, explicit bool) *Node {
// target is invalid type for a constant? leave alone. // target is invalid type for a constant? leave alone.
case OLITERAL: case OLITERAL:
if !okforconst[t.Etype] && n.Type.Etype != TNIL { if !okforconst[t.Etype] && n.Type.Etype != TNIL {
n = defaultlit(n, nil) return defaultlit(n, nil)
return n
} }
case OLSH, ORSH: case OLSH, ORSH:
...@@ -204,9 +203,7 @@ func convlit1(n *Node, t *Type, explicit bool) *Node { ...@@ -204,9 +203,7 @@ func convlit1(n *Node, t *Type, explicit bool) *Node {
n.Type = t n.Type = t
return n return n
} }
return defaultlit(n, nil)
n = defaultlit(n, nil)
return n
} }
switch ct { switch ct {
...@@ -1264,8 +1261,7 @@ func defaultlit(n *Node, t *Type) *Node { ...@@ -1264,8 +1261,7 @@ func defaultlit(n *Node, t *Type) *Node {
switch ctype { switch ctype {
default: default:
if t != nil { if t != nil {
n = convlit(n, t) return convlit(n, t)
return n
} }
if n.Val().Ctype() == CTNIL { if n.Val().Ctype() == CTNIL {
......
...@@ -902,12 +902,11 @@ func esc(e *EscState, n *Node, up *Node) { ...@@ -902,12 +902,11 @@ func esc(e *EscState, n *Node, up *Node) {
// Link addresses of captured variables to closure. // Link addresses of captured variables to closure.
case OCLOSURE: case OCLOSURE:
var a *Node
for _, v := range n.Func.Cvars.Slice() { for _, v := range n.Func.Cvars.Slice() {
if v.Op == OXXX { // unnamed out argument; see dcl.go:/^funcargs if v.Op == OXXX { // unnamed out argument; see dcl.go:/^funcargs
continue continue
} }
a = v.Name.Param.Closure a := v.Name.Param.Closure
if !v.Name.Byval { if !v.Name.Byval {
a = Nod(OADDR, a, nil) a = Nod(OADDR, a, nil)
a.Lineno = v.Lineno a.Lineno = v.Lineno
......
...@@ -225,8 +225,7 @@ func reexportdep(n *Node) { ...@@ -225,8 +225,7 @@ func reexportdep(n *Node) {
} }
func dumpexportconst(s *Sym) { func dumpexportconst(s *Sym) {
n := s.Def n := typecheck(s.Def, Erv)
n = typecheck(n, Erv)
if n == nil || n.Op != OLITERAL { if n == nil || n.Op != OLITERAL {
Fatalf("dumpexportconst: oconst nil: %v", s) Fatalf("dumpexportconst: oconst nil: %v", s)
} }
......
...@@ -292,8 +292,7 @@ func inlconv2stmt(n *Node) { ...@@ -292,8 +292,7 @@ func inlconv2stmt(n *Node) {
// n.Left = inlconv2expr(n.Left) // n.Left = inlconv2expr(n.Left)
func inlconv2expr(n *Node) *Node { func inlconv2expr(n *Node) *Node {
r := n.Rlist.First() r := n.Rlist.First()
r = addinit(r, append(n.Ninit.Slice(), n.Nbody.Slice()...)) return addinit(r, append(n.Ninit.Slice(), n.Nbody.Slice()...))
return r
} }
// Turn the rlist (with the return values) of the OINLCALL in // Turn the rlist (with the return values) of the OINLCALL in
...@@ -509,8 +508,7 @@ func tinlvar(t *Field) *Node { ...@@ -509,8 +508,7 @@ func tinlvar(t *Field) *Node {
return t.Nname.Name.Inlvar return t.Nname.Name.Inlvar
} }
nblank = typecheck(nblank, Erv|Easgn) return typecheck(nblank, Erv|Easgn)
return nblank
} }
var inlgen int var inlgen int
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment