]> Cypherpunks.ru repositories - gostls13.git/commit
[dev.regabi] cmd/compile: rewrite concurrentFlagOk to be clearer
authorRuss Cox <rsc@golang.org>
Sun, 15 Nov 2020 16:40:25 +0000 (11:40 -0500)
committerRuss Cox <rsc@golang.org>
Tue, 24 Nov 2020 14:58:10 +0000 (14:58 +0000)
commit7b144ed4f7a730f5c9375bca65010446ad9f4b73
tree04150c00c58adc59ee9bd23fb20588207017c288
parentc754f25241134eaa68c8f26ed5372cadeb49ef89
[dev.regabi] cmd/compile: rewrite concurrentFlagOk to be clearer

The current implementation copies Debug, clears a bunch of flags
that are meant to be considered OK, and then checks the result
against the zero value. But more flags are cleared than remain:
it's easier to write and to understand to just check the ones that
need checking.

This phrasing also makes it safe to move more flags into the struct.

It turns out that some of the flags being checked should probably
not be checked, but this CL is meant to be a strict semantic no-op,
so left a TODO to clean up the function a bit more later.

Change-Id: I7afe6d7b32b5b889c40dd339568e8602e02df9bc
Reviewed-on: https://go-review.googlesource.com/c/go/+/271666
Trust: Russ Cox <rsc@golang.org>
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
src/cmd/compile/internal/gc/main.go