mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
cmd/compile/internal/gc: remove OCMPIFACE and OCMPSTR
Interface and string comparisons don't need separate Ops any more than struct or array comparisons do. Removing them requires shuffling some code around in walk (and a little in order), but overall allows simplifying things a bit. Passes toolstash-check. Change-Id: I084b8a6c089b768dc76d220379f4daed8a35db15 Reviewed-on: https://go-review.googlesource.com/c/141637 Run-TryBot: Matthew Dempsky <mdempsky@google.com> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org> Reviewed-by: Robert Griesemer <gri@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
This commit is contained in:
parent
f64fd66f24
commit
28fbbf4111
8 changed files with 235 additions and 266 deletions
|
|
@ -65,7 +65,7 @@ func (n *Node) ResetAux() {
|
|||
|
||||
func (n *Node) SubOp() Op {
|
||||
switch n.Op {
|
||||
case OASOP, OCMPIFACE, OCMPSTR, ONAME:
|
||||
case OASOP, ONAME:
|
||||
default:
|
||||
Fatalf("unexpected op: %v", n.Op)
|
||||
}
|
||||
|
|
@ -74,7 +74,7 @@ func (n *Node) SubOp() Op {
|
|||
|
||||
func (n *Node) SetSubOp(op Op) {
|
||||
switch n.Op {
|
||||
case OASOP, OCMPIFACE, OCMPSTR, ONAME:
|
||||
case OASOP, ONAME:
|
||||
default:
|
||||
Fatalf("unexpected op: %v", n.Op)
|
||||
}
|
||||
|
|
@ -610,8 +610,8 @@ const (
|
|||
OCAP // cap(Left)
|
||||
OCLOSE // close(Left)
|
||||
OCLOSURE // func Type { Body } (func literal)
|
||||
OCMPIFACE // Left Etype Right (interface comparison, x == y or x != y)
|
||||
OCMPSTR // Left Etype Right (string comparison, x == y, x < y, etc)
|
||||
_ // toolstash kludge; was OCMPIFACE
|
||||
_ // toolstash kludge; was OCMPSTR
|
||||
OCOMPLIT // Right{List} (composite literal, not yet lowered to specific form)
|
||||
OMAPLIT // Type{List} (composite literal, Type is map)
|
||||
OSTRUCTLIT // Type{List} (composite literal, Type is struct)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue