mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
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>
This commit is contained in:
parent
3a89065c6c
commit
2c50bffee1
5 changed files with 44 additions and 28 deletions
|
|
@ -26,7 +26,7 @@ func TestSizeof(t *testing.T) {
|
|||
{Name{}, 36, 56},
|
||||
{Param{}, 28, 56},
|
||||
{Node{}, 84, 136},
|
||||
{Sym{}, 64, 112},
|
||||
{Sym{}, 60, 104},
|
||||
{Type{}, 52, 88},
|
||||
{MapType{}, 20, 40},
|
||||
{ForwardType{}, 20, 32},
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue