• Josh Bleecher Snyder's avatar
    cmd/compile: simplify funcsyms · 2c50bffe
    Josh Bleecher Snyder authored
    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/38605Reviewed-by: 's avatarMatthew Dempsky <mdempsky@google.com>
    2c50bffe
go.go 7.59 KB