diff options
author | Andrew MacLeod <amacleod@redhat.com> | 2023-06-10 16:09:58 -0400 |
---|---|---|
committer | Andrew MacLeod <amacleod@redhat.com> | 2023-06-12 10:48:30 -0400 |
commit | b08b98254a973e67472c9c31bfd9b7e8af6a5133 (patch) | |
tree | 2e1b733b7d65811be624cd5aa91dc9e068c16755 | |
parent | b23d6b957f0a083b252c616d48f92b933f753262 (diff) | |
download | gcc-b08b98254a973e67472c9c31bfd9b7e8af6a5133.zip gcc-b08b98254a973e67472c9c31bfd9b7e8af6a5133.tar.gz gcc-b08b98254a973e67472c9c31bfd9b7e8af6a5133.tar.bz2 |
Move operator_min to the unified range-op table.
* range-op-mixed.h (class operator_min): Move from...
* range-op.cc (unified_table::unified_table): Add MIN_EXPR.
(class operator_min): Move from here.
(integral_table::integral_table): Remove MIN_EXPR.
-rw-r--r-- | gcc/range-op-mixed.h | 11 | ||||
-rw-r--r-- | gcc/range-op.cc | 18 |
2 files changed, 18 insertions, 11 deletions
diff --git a/gcc/range-op-mixed.h b/gcc/range-op-mixed.h index 8a11d61..7bd9b5e 100644 --- a/gcc/range-op-mixed.h +++ b/gcc/range-op-mixed.h @@ -596,4 +596,15 @@ private: const wide_int &rh_ub) const final override; }; +class operator_min : public range_operator +{ +public: + void update_bitmask (irange &r, const irange &lh, + const irange &rh) const final override; +private: + 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 final override; +}; + #endif // GCC_RANGE_OP_MIXED_H diff --git a/gcc/range-op.cc b/gcc/range-op.cc index 07e0c88..a777fb0 100644 --- a/gcc/range-op.cc +++ b/gcc/range-op.cc @@ -80,6 +80,7 @@ operator_bitwise_not op_bitwise_not; operator_bitwise_xor op_bitwise_xor; operator_bitwise_and op_bitwise_and; operator_bitwise_or op_bitwise_or; +operator_min op_min; // Invoke the initialization routines for each class of range. @@ -119,6 +120,7 @@ unified_table::unified_table () // speifc version is provided. set (BIT_AND_EXPR, op_bitwise_and); set (BIT_IOR_EXPR, op_bitwise_or); + set (MIN_EXPR, op_min); } // The tables are hidden and accessed via a simple extern function. @@ -1980,17 +1982,12 @@ operator_pointer_diff::op1_op2_relation_effect (irange &lhs_range, tree type, } -class operator_min : public range_operator +void +operator_min::update_bitmask (irange &r, const irange &lh, + const irange &rh) const { -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; - void update_bitmask (irange &r, const irange &lh, const irange &rh) const - { update_known_bitmask (r, MIN_EXPR, lh, rh); } -} op_min; + update_known_bitmask (r, MIN_EXPR, lh, rh); +} void operator_min::wi_fold (irange &r, tree type, @@ -4534,7 +4531,6 @@ pointer_or_operator::wi_fold (irange &r, tree type, integral_table::integral_table () { - set (MIN_EXPR, op_min); set (MAX_EXPR, op_max); } |