aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/compile/internal/typecheck/expr.go
diff options
context:
space:
mode:
authorMatthew Dempsky <mdempsky@google.com>2021-08-26 11:29:44 -0700
committerMatthew Dempsky <mdempsky@google.com>2021-08-26 19:07:27 +0000
commit1f8d4562debf8310910897ea85705cc067baa52d (patch)
tree898bc2959b4ddc8eb22685341ac89b74faf277e9 /src/cmd/compile/internal/typecheck/expr.go
parent5e6a7e9b860d7c8f589eec3c123469ea8071689f (diff)
downloadgo-1f8d4562debf8310910897ea85705cc067baa52d.tar.gz
go-1f8d4562debf8310910897ea85705cc067baa52d.zip
cmd/compile: change typecheck.iscmp into ir.Op.IsCmp
Change-Id: If89089cbd79b7ff030d856df3a7e6b7862c0f4ec Reviewed-on: https://go-review.googlesource.com/c/go/+/345412 Trust: Matthew Dempsky <mdempsky@google.com> Run-TryBot: Matthew Dempsky <mdempsky@google.com> Reviewed-by: Cuong Manh Le <cuong.manhle.vn@gmail.com> TryBot-Result: Go Bot <gobot@golang.org>
Diffstat (limited to 'src/cmd/compile/internal/typecheck/expr.go')
-rw-r--r--src/cmd/compile/internal/typecheck/expr.go6
1 files changed, 1 insertions, 5 deletions
diff --git a/src/cmd/compile/internal/typecheck/expr.go b/src/cmd/compile/internal/typecheck/expr.go
index 7e974dfda8..d83bc65bed 100644
--- a/src/cmd/compile/internal/typecheck/expr.go
+++ b/src/cmd/compile/internal/typecheck/expr.go
@@ -77,10 +77,6 @@ func tcShift(n, l, r ir.Node) (ir.Node, ir.Node, *types.Type) {
return l, r, t
}
-func IsCmp(op ir.Op) bool {
- return iscmp[op]
-}
-
// tcArith typechecks operands of a binary arithmetic expression.
// The result of tcArith MUST be assigned back to original operands,
// t is the type of the expression, and should be set by the caller. e.g:
@@ -96,7 +92,7 @@ func tcArith(n ir.Node, op ir.Op, l, r ir.Node) (ir.Node, ir.Node, *types.Type)
t = r.Type()
}
aop := ir.OXXX
- if iscmp[n.Op()] && t.Kind() != types.TIDEAL && !types.Identical(l.Type(), r.Type()) {
+ if n.Op().IsCmp() && t.Kind() != types.TIDEAL && !types.Identical(l.Type(), r.Type()) {
// comparison is okay as long as one side is
// assignable to the other. convert so they have
// the same type.