]> Cypherpunks repositories - gostls13.git/commit
cmd/compile: simplify funcsyms
authorJosh Bleecher Snyder <josharian@gmail.com>
Fri, 24 Mar 2017 18:33:29 +0000 (11:33 -0700)
committerJosh Bleecher Snyder <josharian@gmail.com>
Fri, 24 Mar 2017 23:34:24 +0000 (23:34 +0000)
commit2c50bffee1c49d71ec1ea2c6cad10570ad780a4b
tree500139eec8711338c95c9cb336e6150c3a049674
parent3a89065c6c72162ac9c5f7b268c3e46ebee3cc7f
cmd/compile: simplify funcsyms

Sym.Fsym is used only to avoid adding duplicate
entries to funcsyms, but that is easily
accomplished by detecting the first lookup
vs subsequent lookups of the func sym name.

This avoids creating an unnecessary ONAME node
during funcsym, which eliminates a dependency
in the backend on Curfn and lineno.

It also makes the code a lot simpler and clearer.

Updates #15756

Passes toolstash-check -all.
No compiler performance changes.
funcsymname does generate garbage via string
concatenation, but it is not called very much,
and this CL also eliminates allocation of several
Nodes and Names.

Change-Id: I7116c78fa39d975b7bd2c65a1d228749cf0dd46b
Reviewed-on: https://go-review.googlesource.com/38605
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
src/cmd/compile/internal/gc/dcl.go
src/cmd/compile/internal/gc/go.go
src/cmd/compile/internal/gc/obj.go
src/cmd/compile/internal/gc/sizeof_test.go
src/cmd/compile/internal/gc/subr.go