• Josh Bleecher Snyder's avatar
    cmd/compile: move Used from gc.Node to gc.Name · fc08a19c
    Josh Bleecher Snyder authored
    Node.Used was written to from the backend
    concurrently with reads of Node.Class
    for the same ONAME Nodes.
    I do not know why it was not failing consistently
    under the race detector, but it is a race.
    
    This is likely also a problem with Node.HasVal and Node.HasOpt.
    They will be handled in a separate CL.
    
    Fix Used by moving it to gc.Name and making it a separate bool.
    There was one non-Name use of Used, marking OLABELs as used.
    That is no longer needed, now that goto and label checking
    happens early in the front end.
    
    Leave the getters and setters in place,
    to ease changing the representation in the future
    (or changing to an interface!).
    
    Updates #20144
    
    Change-Id: I9bec7c6d33dcb129a4cfa9d338462ea33087f9f7
    Reviewed-on: https://go-review.googlesource.com/42015
    Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com>
    TryBot-Result: Gobot Gobot <gobot@golang.org>
    Reviewed-by: 's avatarMatthew Dempsky <mdempsky@google.com>
    fc08a19c
esc.go 64.9 KB