From a1aaaff33a79d1b7613fbf8a17b51321a135f19c Mon Sep 17 00:00:00 2001 From: Andrew MacLeod Date: Fri, 9 Jun 2023 13:42:08 -0400 Subject: Unify ABS_EXPR range operator Move the declaration of the class to the range-op-mixed header, add the floating point prototypes as well, and use it in the new unified table. * range-op-float.cc (foperator_abs): Remove. Move prototypes to range-op-mixed.h (operator_abs::fold_range): Rename from foperator_abs. (operator_abs::op1_range): Ditto. (float_table::float_table): Remove ABS_EXPR. * range-op-mixed.h (class operator_abs): Combined from integer and float files. * range-op.cc (op_abs): New object. (unified_table::unified_table): Add ABS_EXPR. (class operator_abs): Move to range-op-mixed.h. (integral_table::integral_table): Remove ABS_EXPR. (pointer_table::pointer_table): Remove ABS_EXPR. --- gcc/range-op.cc | 18 ++---------------- 1 file changed, 2 insertions(+), 16 deletions(-) (limited to 'gcc/range-op.cc') diff --git a/gcc/range-op.cc b/gcc/range-op.cc index 1dc5c38..b4cdaf5 100644 --- a/gcc/range-op.cc +++ b/gcc/range-op.cc @@ -72,6 +72,7 @@ operator_identity op_ident; operator_cst op_cst; operator_cast op_cast; operator_plus op_plus; +operator_abs op_abs; // Invoke the initialization routines for each class of range. @@ -95,6 +96,7 @@ unified_table::unified_table () set (NOP_EXPR, op_cast); set (CONVERT_EXPR, op_cast); set (PLUS_EXPR, op_plus); + set (ABS_EXPR, op_abs); } // The tables are hidden and accessed via a simple extern function. @@ -4249,21 +4251,6 @@ operator_unknown::fold_range (irange &r, tree type, } -class operator_abs : public range_operator -{ - using range_operator::op1_range; - public: - virtual void wi_fold (irange &r, tree type, - const wide_int &lh_lb, - const wide_int &lh_ub, - const wide_int &rh_lb, - const wide_int &rh_ub) const; - virtual bool op1_range (irange &r, tree type, - const irange &lhs, - const irange &op2, - relation_trio) const; -} op_abs; - void operator_abs::wi_fold (irange &r, tree type, const wide_int &lh_lb, const wide_int &lh_ub, @@ -4703,7 +4690,6 @@ integral_table::integral_table () set (BIT_IOR_EXPR, op_bitwise_or); set (BIT_XOR_EXPR, op_bitwise_xor); set (BIT_NOT_EXPR, op_bitwise_not); - set (ABS_EXPR, op_abs); set (NEGATE_EXPR, op_negate); set (ADDR_EXPR, op_addr); } -- cgit v1.1