]> git.ipfire.org Git - thirdparty/gcc.git/commit
Add operand_check_p to range-ops.
authorAndrew MacLeod <amacleod@redhat.com>
Tue, 28 Nov 2023 14:39:30 +0000 (09:39 -0500)
committerAndrew MacLeod <amacleod@redhat.com>
Wed, 29 Nov 2023 16:43:53 +0000 (11:43 -0500)
commitea19de921b01a6ab470929f8da4dde526edb08f1
tree5088e0a596202dc03e252f4956c009488989a119
parent302461ad9a04d82fee904bddac69811d13d5bb6a
Add operand_check_p to range-ops.

Add an optional method to verify operands are compatible, and check
the operands before all range operations.

* range-op-mixed.h (operator_equal::operand_check_p): New.
(operator_not_equal::operand_check_p): New.
(operator_lt::operand_check_p): New.
(operator_le::operand_check_p): New.
(operator_gt::operand_check_p): New.
(operator_ge::operand_check_p): New.
(operator_plus::operand_check_p): New.
(operator_abs::operand_check_p): New.
(operator_minus::operand_check_p): New.
(operator_negate::operand_check_p): New.
(operator_mult::operand_check_p): New.
(operator_bitwise_not::operand_check_p): New.
(operator_bitwise_xor::operand_check_p): New.
(operator_bitwise_and::operand_check_p): New.
(operator_bitwise_or::operand_check_p): New.
(operator_min::operand_check_p): New.
(operator_max::operand_check_p): New.
* range-op.cc (range_op_handler::fold_range): Check operand
parameter types.
(range_op_handler::op1_range): Ditto.
(range_op_handler::op2_range): Ditto.
(range_op_handler::operand_check_p): New.
(range_operator::operand_check_p): New.
(operator_lshift::operand_check_p): New.
(operator_rshift::operand_check_p): New.
(operator_logical_and::operand_check_p): New.
(operator_logical_or::operand_check_p): New.
(operator_logical_not::operand_check_p): New.
* range-op.h (range_operator::operand_check_p): New.
(range_op_handler::operand_check_p): New.
gcc/range-op-mixed.h
gcc/range-op.cc
gcc/range-op.h