]> Cypherpunks repositories - gostls13.git/commit
cmd/compile: clean up various bits of code
authorDaniel Martí <mvdan@mvdan.cc>
Fri, 20 Oct 2017 10:56:31 +0000 (11:56 +0100)
committerDaniel Martí <mvdan@mvdan.cc>
Sun, 22 Oct 2017 15:50:50 +0000 (15:50 +0000)
commit006bc57095e7b1221ecc292735a510a52a27292c
tree3980ce4405c2a4ba6f3b470ca28d32017280081c
parent7092a312e5651c31e4a075503b0f5799371ceef9
cmd/compile: clean up various bits of code

* replace a copy of IsMethod with a call of it.
* a few more switches where they simplify the code.
* prefer composite literals over "n := new(...); n.x = y; ...".
* use defers to get rid of three goto labels.
* rewrite updateHasCall into two funcs to remove gotos.

Passes toolstash-check on std cmd.

Change-Id: Icb5442a89a87319ef4b640bbc5faebf41b193ef1
Reviewed-on: https://go-review.googlesource.com/72070
Run-TryBot: Daniel Martí <mvdan@mvdan.cc>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
src/cmd/compile/internal/gc/const.go
src/cmd/compile/internal/gc/esc.go
src/cmd/compile/internal/gc/export.go
src/cmd/compile/internal/gc/gsubr.go
src/cmd/compile/internal/gc/obj.go
src/cmd/compile/internal/gc/select.go
src/cmd/compile/internal/gc/ssa.go
src/cmd/compile/internal/gc/subr.go
src/cmd/compile/internal/gc/walk.go