From: zdjones Date: Fri, 30 Aug 2019 13:41:09 +0000 (+0100) Subject: [release-branch.go1.13] cmd/compile: rename poset method dominates to reaches X-Git-Tag: go1.13.3~8 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=c16e37eab9666dc1905f8d5668392510a5b23134;p=gostls13.git [release-branch.go1.13] cmd/compile: rename poset method dominates to reaches The partially ordered set uses a method named 'dominates' to determine whether two nodes are partially ordered. Dominates does a depth-first search of the DAG, beginning at the source node, and returns true as soon as it finds a path to the target node. In the context of the forest-of-DAGs that makes up the poset, dominates is not necessarily checking dominance, but is checking reachability. See the issue tracker for a more detailed discussion of the difference. Fortunately, reachability is logically correct everywhere dominates is currently used in poset.go. Reachability within a DAG is sufficient to establish the partial ordering (source < target). This CL changes the name of the method (dominates -> reaches) and updates all the comments in the file accordingly. Updates #34807 Change-Id: Ia3a34f7b14b363801d75b05099cfc686035f7d96 Reviewed-on: https://go-review.googlesource.com/c/go/+/192617 Reviewed-by: Giovanni Bajo Run-TryBot: Giovanni Bajo TryBot-Result: Gobot Gobot Reviewed-on: https://go-review.googlesource.com/c/go/+/201059 Run-TryBot: Alexander Rakoczy Reviewed-by: Keith Randall --- diff --git a/src/cmd/compile/internal/ssa/poset.go b/src/cmd/compile/internal/ssa/poset.go index 4ebfb89e52..071297f8fa 100644 --- a/src/cmd/compile/internal/ssa/poset.go +++ b/src/cmd/compile/internal/ssa/poset.go @@ -116,10 +116,10 @@ type posetNode struct { // the nodes are different, either because SetNonEqual was called before, or because // we know that they are strictly ordered. // -// It is implemented as a forest of DAGs; in each DAG, if node A dominates B, -// it means that A