mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
cmd/compile: in poset, improve panic strings and comments
No functional changes. Change-Id: I6f5e811e141dd09dc5c47ff2d37fae4c640315e3 Reviewed-on: https://go-review.googlesource.com/c/go/+/200862 Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
This commit is contained in:
parent
c3a871fde1
commit
233f45499b
1 changed files with 4 additions and 3 deletions
|
|
@ -874,7 +874,7 @@ func (po *poset) NonEqual(n1, n2 *Value) bool {
|
||||||
defer po.CheckIntegrity()
|
defer po.CheckIntegrity()
|
||||||
}
|
}
|
||||||
if n1.ID == n2.ID {
|
if n1.ID == n2.ID {
|
||||||
panic("should not call Equal with n1==n2")
|
panic("should not call NonEqual with n1==n2")
|
||||||
}
|
}
|
||||||
if po.isnoneq(n1.ID, n2.ID) {
|
if po.isnoneq(n1.ID, n2.ID) {
|
||||||
return true
|
return true
|
||||||
|
|
@ -888,7 +888,8 @@ func (po *poset) NonEqual(n1, n2 *Value) bool {
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
// setOrder records that n1<n2 or n1<=n2 (depending on strict).
|
// setOrder records that n1<n2 or n1<=n2 (depending on strict). Returns false
|
||||||
|
// if this is a contradiction.
|
||||||
// Implements SetOrder() and SetOrderOrEqual()
|
// Implements SetOrder() and SetOrderOrEqual()
|
||||||
func (po *poset) setOrder(n1, n2 *Value, strict bool) bool {
|
func (po *poset) setOrder(n1, n2 *Value, strict bool) bool {
|
||||||
// If we are trying to record n1<=n2 but we learned that n1!=n2,
|
// If we are trying to record n1<=n2 but we learned that n1!=n2,
|
||||||
|
|
@ -1110,7 +1111,7 @@ func (po *poset) SetNonEqual(n1, n2 *Value) bool {
|
||||||
defer po.CheckIntegrity()
|
defer po.CheckIntegrity()
|
||||||
}
|
}
|
||||||
if n1.ID == n2.ID {
|
if n1.ID == n2.ID {
|
||||||
panic("should not call Equal with n1==n2")
|
panic("should not call SetNonEqual with n1==n2")
|
||||||
}
|
}
|
||||||
|
|
||||||
// See if we already know this
|
// See if we already know this
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue