[dev.regabi] cmd/compile: avoid general traversal in deadcode
[dev.regabi] cmd/compile: avoid general traversal in deadcode

deadcode is trying to walk the statements it can find,
but it can sweep in other nodes too. Stop doing that:
only walk known statements containing statements.

Otherwise, if we put panics in expression accessors that
shouldn't be used anymore, deadcode can trip them.

deadcode would be a good candidate to rewrite using
EditChildren, but that would certainly cause toolstash
changes, since deadcode is so ad-hoc about exactly
which parts of the function it looks at. For now just
remove the general traversal and leave as is.

Passes buildall w/ toolstash -cmp.

Change-Id: I06481eb87350905597600203c4fa724d55645b46
Reviewed-on: https://go-review.googlesource.com/c/go/+/275377
Trust: Russ Cox <5ad239cb8a44f659eaaee0aa1ea5b94947abe557@golang.org>
Run-TryBot: Russ Cox <5ad239cb8a44f659eaaee0aa1ea5b94947abe557@golang.org>
Reviewed-by: Matthew Dempsky <e56ac2c500064424afac424d4b5e53bd0570a731@google.com>

nawawi/go,nawawi/go,cloudflare/go,golang/go,CAFxX/go,cloudflare/go,golang/go,CAFxX/go,cloudflare/go,cloudflare/go,nawawi/go,golang/go,cloudflare/go,nawawi/go,CAFxX/go,CAFxX/go,nawawi/go,nawawi/go,CAFxX/go,golang/go,nawawi/go,cloudflare/go,CAFxX/go,golang/go,nawawi/go,CAFxX/go,cloudflare/go,golang/go,cloudflare/go,golang/go,golang/go,CAFxX/go