diff options
author | Andrew MacLeod <amacleod@redhat.com> | 2023-06-09 13:43:12 -0400 |
---|---|---|
committer | Andrew MacLeod <amacleod@redhat.com> | 2023-06-09 20:33:03 -0400 |
commit | 56518befc2663ddc082e34dddd66b6334a3d4da5 (patch) | |
tree | 214c4958b470b252d48016ef10c450a9fe0ed544 /gcc/range-op.cc | |
parent | d5818a361779e19b9c17295c6a014c4145c73937 (diff) | |
download | gcc-56518befc2663ddc082e34dddd66b6334a3d4da5.zip gcc-56518befc2663ddc082e34dddd66b6334a3d4da5.tar.gz gcc-56518befc2663ddc082e34dddd66b6334a3d4da5.tar.bz2 |
Unify NEGATE_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_negate): Remove. Move prototypes
to range-op-mixed.h
(operator_negate::fold_range): Rename from foperator_negate.
(operator_negate::op1_range): Ditto.
(float_table::float_table): Remove NEGATE_EXPR.
* range-op-mixed.h (class operator_negate): Combined from integer
and float files.
* range-op.cc (op_negate): New object.
(unified_table::unified_table): Add NEGATE_EXPR.
(class operator_negate): Move to range-op-mixed.h.
(integral_table::integral_table): Remove NEGATE_EXPR.
(pointer_table::pointer_table): Remove NEGATE_EXPR.
Diffstat (limited to 'gcc/range-op.cc')
-rw-r--r-- | gcc/range-op.cc | 18 |
1 files changed, 2 insertions, 16 deletions
diff --git a/gcc/range-op.cc b/gcc/range-op.cc index 2094479..539036d 100644 --- a/gcc/range-op.cc +++ b/gcc/range-op.cc @@ -74,6 +74,7 @@ operator_cast op_cast; operator_plus op_plus; operator_abs op_abs; operator_minus op_minus; +operator_negate op_negate; // Invoke the initialization routines for each class of range. @@ -99,6 +100,7 @@ unified_table::unified_table () set (PLUS_EXPR, op_plus); set (ABS_EXPR, op_abs); set (MINUS_EXPR, op_minus); + set (NEGATE_EXPR, op_negate); } // The tables are hidden and accessed via a simple extern function. @@ -4378,21 +4380,6 @@ operator_absu::wi_fold (irange &r, tree type, } -class operator_negate : public range_operator -{ - using range_operator::fold_range; - using range_operator::op1_range; - public: - virtual bool fold_range (irange &r, tree type, - const irange &op1, - const irange &op2, - relation_trio rel = TRIO_VARYING) const; - virtual bool op1_range (irange &r, tree type, - const irange &lhs, - const irange &op2, - relation_trio rel = TRIO_VARYING) const; -} op_negate; - bool operator_negate::fold_range (irange &r, tree type, const irange &lh, @@ -4665,7 +4652,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 (NEGATE_EXPR, op_negate); set (ADDR_EXPR, op_addr); } |