]> Cypherpunks.ru repositories - gostls13.git/commit
[dev.regabi] cmd/compile: rename ir.Find to ir.Any and update uses
authorRuss Cox <rsc@golang.org>
Wed, 16 Dec 2020 15:53:20 +0000 (10:53 -0500)
committerRuss Cox <rsc@golang.org>
Fri, 18 Dec 2020 17:52:47 +0000 (17:52 +0000)
commit0b9cb63b8df352e2cb34b32452d9645ae621f9a1
tree39d46e8c45005873866376c6d1137d19af346ae5
parentaeedc9f804e929a8a1c4340f3306b5ef6df8d850
[dev.regabi] cmd/compile: rename ir.Find to ir.Any and update uses

ir.Find is called "any" in C#, Dart, Haskell, Python, R, Ruby, and Rust,
and "any_of" in C++, "anyMatch" in Java, "some" in JavaScript,
"exists in OCaml, and "existsb" in Coq.
(Thanks to Matthew Dempsky for the research.)

This CL changes Find to Any to use the mostly standard name.

It also updates wrapper helpers to use the any terminology:
hasCall -> anyCall
hasCallOrChan -> anyCallOrChan
hasSideEffects -> anySideEffects

Unchanged are "hasNamedResults", "hasUniquePos", and "hasDefaultCase",
which are all about a single node, not any node in the IR tree.

I also renamed hasFall to endsInFallthrough, since its semantics are
neither that of "any" nor that of the remaining "has" functions.

So the new terminology helps separate different kinds of predicates nicely.

Change-Id: I9bb3c9ebf060a30447224be09a5c34ad5244ea0d
Reviewed-on: https://go-review.googlesource.com/c/go/+/278912
Trust: Russ Cox <rsc@golang.org>
Run-TryBot: Russ Cox <rsc@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
src/cmd/compile/internal/gc/alg.go
src/cmd/compile/internal/gc/const.go
src/cmd/compile/internal/gc/inl.go
src/cmd/compile/internal/gc/sinit.go
src/cmd/compile/internal/gc/swt.go
src/cmd/compile/internal/gc/walk.go
src/cmd/compile/internal/ir/visit.go