• Than McIntosh's avatar
    cmd/compile: avoid truncating fieldname var locations · d80e8de5
    Than McIntosh authored
    Don't include package path when creating LSyms for auto and param
    variables during Prog generation, and update the DWARF emit routine
    accordingly (remove the code that chops off package path from names in
    DWARF var location expressions). Implementation suggested by mdempsky@.
    
    The intent of this change is to have saner location expressions in cases
    where the variable corresponds to a structure field. For example, the
    SSA compiler's "decompose" phase can take a slice value and break it
    apart into three scalar variables corresponding to the fields (slice "X"
    gets split into "X.len", "X.cap", "X.ptr"). In such cases we want the
    name in the location expression to omit the package path but preserve
    the original variable name (e.g. "X").
    
    Fixes #16338
    
    Change-Id: Ibc444e7f3454b70fc500a33f0397e669d127daa1
    Reviewed-on: https://go-review.googlesource.com/31819
    Run-TryBot: Than McIntosh <thanm@google.com>
    TryBot-Result: Gobot Gobot <gobot@golang.org>
    Reviewed-by: 's avatarMatthew Dempsky <mdempsky@google.com>
    d80e8de5
Name
Last commit
Last update
..
dwarf.go Loading commit data...
dwarf_defs.go Loading commit data...