]> Cypherpunks repositories - gostls13.git/commit
cmd/compile: remove funcdepth variables
authorMatthew Dempsky <mdempsky@google.com>
Wed, 7 Mar 2018 02:30:58 +0000 (18:30 -0800)
committerMatthew Dempsky <mdempsky@google.com>
Wed, 7 Mar 2018 06:05:18 +0000 (06:05 +0000)
commitd7eb4901f18b25aa35de648dacb6bc04528bab6e
tree8d8d3576bd07a573b87693ae34244eb46eadc447
parentaa00ca12fe5f342f97fe7335e107848f1b7880bd
cmd/compile: remove funcdepth variables

There were only two large classes of use for these variables:

1) Testing "funcdepth != 0" or "funcdepth > 0", which is equivalent to
checking "Curfn != nil".

2) In oldname, detecting whether a closure variable has been created
for the current function, which can be handled by instead testing
"n.Name.Curfn != Curfn".

Lastly, merge funcstart into funchdr, since it's only called once, and
it better matches up with funcbody now.

Passes toolstash-check.

Change-Id: I8fe159a9d37ef7debc4cd310354cea22a8b23394
Reviewed-on: https://go-review.googlesource.com/99076
Run-TryBot: Matthew Dempsky <mdempsky@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
src/cmd/compile/internal/gc/bimport.go
src/cmd/compile/internal/gc/closure.go
src/cmd/compile/internal/gc/dcl.go
src/cmd/compile/internal/gc/fmt.go
src/cmd/compile/internal/gc/pgen.go
src/cmd/compile/internal/gc/sizeof_test.go
src/cmd/compile/internal/gc/syntax.go
src/cmd/compile/internal/gc/walk.go