cmd/compile: move some ONAME-specific flags from Node to Name
The IsClosureVar, IsOutputParamHeapAddr, Assigned, Addrtaken, InlFormal, and InlLocal flags are only interesting for ONAME nodes, so it's better to set these flags on Name.flags instead of Node.flags. Two caveats though: 1. Previously, we would set Assigned and Addrtaken on the entire expression tree involved in an assignment or addressing operation. However, the rest of the compiler only actually cares about knowing whether the underlying ONAME (if any) was assigned/addressed. 2. This actually requires bumping Name.flags from bitset8 to bitset16, whereas it doesn't allow shrinking Node.flags any. However, Name has some trailing padding bytes, so expanding Name.flags doesn't cost any memory. Passes toolstash-check. Change-Id: I7775d713566a38d5b9723360b1659b79391744c2 Reviewed-on: https://go-review.googlesource.com/c/go/+/200898 Run-TryBot: Matthew Dempsky <mdempsky@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Showing
This diff is collapsed.
Please register or sign in to comment