]> git.ipfire.org Git - thirdparty/gcc.git/commit
Unify range_operators to one class.
authorAndrew MacLeod <amacleod@redhat.com>
Wed, 31 May 2023 16:31:53 +0000 (12:31 -0400)
committerAndrew MacLeod <amacleod@redhat.com>
Thu, 8 Jun 2023 18:52:04 +0000 (14:52 -0400)
commit9c0fed507f059d54c6753f86a2a10a0c743a7f95
tree05f4d4351b16cbbc4e13f685857cde8a15d7194f
parentcd4b7e8b6232c42001b63a0cb4f743536e2faee1
Unify range_operators to one class.

Range_operator and range_operator_float are 2 different classes, making
generalized dispatch difficult.  The distinction between what is a float
operator and what is an integral operator also blurs when some methods
have multiple types.  ie, casts : INT = FLOAT and FLOAT = INT

This patch unifies all possible invocation patterns in one class, and
switches the float table to use the general range_op_table.

* gimple-range-op.cc (cfn_constant_float_p): Change base class.
(cfn_pass_through_arg1): Adjust using statemenmt.
(cfn_signbit): Change base class, adjust using statement.
(cfn_copysign): Ditto.
(cfn_sqrt): Ditto.
(cfn_sincos): Ditto.
* range-op-float.cc (fold_range): Change class to range_operator.
(rv_fold): Ditto.
(op1_range): Ditto
(op2_range): Ditto
(lhs_op1_relation): Ditto.
(lhs_op2_relation): Ditto.
(op1_op2_relation): Ditto.
(foperator_*): Ditto.
(class float_table): New.  Inherit from range_op_table.
(floating_tree_table) Change to range_op_table pointer.
(class floating_op_table): Delete.
* range-op.cc (operator_equal): Adjust using statement.
(operator_not_equal): Ditto.
(operator_lt, operator_le, operator_gt, operator_ge): Ditto.
(operator_minus, operator_cast): Ditto.
(operator_bitwise_and, pointer_plus_operator): Ditto.
(get_float_handle): Change return type.
* range-op.h (range_operator_float): Delete.  Relocate all methods
into class range_operator.
(range_op_handler::m_float): Change type to range_operator.
(floating_op_table): Delete.
(floating_tree_table): Change type.
gcc/gimple-range-op.cc
gcc/range-op-float.cc
gcc/range-op.cc
gcc/range-op.h