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
|
|
@ -1146,8 +1146,6 @@ var opprec = []int{
|
|||
OGE: 4,
|
||||
OGT: 4,
|
||||
ONE: 4,
|
||||
OCMPSTR: 4,
|
||||
OCMPIFACE: 4,
|
||||
OSEND: 3,
|
||||
OANDAND: 2,
|
||||
OOROR: 1,
|
||||
|
|
@ -1507,11 +1505,6 @@ func (n *Node) exprfmt(s fmt.State, prec int, mode fmtMode) {
|
|||
n1.exprfmt(s, nprec, mode)
|
||||
}
|
||||
|
||||
case OCMPSTR, OCMPIFACE:
|
||||
n.Left.exprfmt(s, nprec, mode)
|
||||
mode.Fprintf(s, " %#v ", n.SubOp())
|
||||
n.Right.exprfmt(s, nprec+1, mode)
|
||||
|
||||
default:
|
||||
mode.Fprintf(s, "<node %v>", n.Op)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue