Currently, the tcArith logic is complicated and involes many
un-necessary checks for some ir.Op. This CL refactors how it works:
- Add a new tcShiftOp function, which only does necessary works for
typechecking OLSH/ORSH. That ends up moving OLSH/ORSH to a separated
case in typecheck1.
- Move OASOP to separated case, so its logic is detached from tcArith.
- Move OANDAND/OOROR to separated case, which does some validation
dedicated to logical operators only.
Passes toolstash -cmp.
Change-Id: I0db7b7c7a3e52d6f9e9d87eee6967871f1c32200
Reviewed-on: https://go-review.googlesource.com/c/go/+/279442
Trust: Cuong Manh Le <cuong.manhle.vn@gmail.com>
Run-TryBot: Cuong Manh Le <cuong.manhle.vn@gmail.com>
TryBot-Result: Go Bot <gobot@golang.org> Reviewed-by: Matthew Dempsky <mdempsky@google.com>