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: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
delete(prealloc, func_)
}
- clos = walkexpr(clos, init)
-
- return clos
+ return walkexpr(clos, init)
}
func typecheckpartialcall(fn *Node, sym *Sym) {
delete(prealloc, n)
}
- clos = walkexpr(clos, init)
-
- return clos
+ return walkexpr(clos, init)
}
// target is invalid type for a constant? leave alone.
case OLITERAL:
if !okforconst[t.Etype] && n.Type.Etype != TNIL {
- n = defaultlit(n, nil)
- return n
+ return defaultlit(n, nil)
}
case OLSH, ORSH:
n.Type = t
return n
}
-
- n = defaultlit(n, nil)
- return n
+ return defaultlit(n, nil)
}
switch ct {
switch ctype {
default:
if t != nil {
- n = convlit(n, t)
- return n
+ return convlit(n, t)
}
if n.Val().Ctype() == CTNIL {
// Link addresses of captured variables to closure.
case OCLOSURE:
- var a *Node
for _, v := range n.Func.Cvars.Slice() {
if v.Op == OXXX { // unnamed out argument; see dcl.go:/^funcargs
continue
}
- a = v.Name.Param.Closure
+ a := v.Name.Param.Closure
if !v.Name.Byval {
a = Nod(OADDR, a, nil)
a.Lineno = v.Lineno
}
func dumpexportconst(s *Sym) {
- n := s.Def
- n = typecheck(n, Erv)
+ n := typecheck(s.Def, Erv)
if n == nil || n.Op != OLITERAL {
Fatalf("dumpexportconst: oconst nil: %v", s)
}
// n.Left = inlconv2expr(n.Left)
func inlconv2expr(n *Node) *Node {
r := n.Rlist.First()
- r = addinit(r, append(n.Ninit.Slice(), n.Nbody.Slice()...))
- return r
+ return addinit(r, append(n.Ninit.Slice(), n.Nbody.Slice()...))
}
// Turn the rlist (with the return values) of the OINLCALL in
return t.Nname.Name.Inlvar
}
- nblank = typecheck(nblank, Erv|Easgn)
- return nblank
+ return typecheck(nblank, Erv|Easgn)
}
var inlgen int