public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc r14-1724] Move operator_min to the unified range-op table.
@ 2023-06-12 15:32 Andrew Macleod
  0 siblings, 0 replies; only message in thread
From: Andrew Macleod @ 2023-06-12 15:32 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:b08b98254a973e67472c9c31bfd9b7e8af6a5133

commit r14-1724-gb08b98254a973e67472c9c31bfd9b7e8af6a5133
Author: Andrew MacLeod <amacleod@redhat.com>
Date:   Sat Jun 10 16:09:58 2023 -0400

    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.

Diff:
---
 gcc/range-op-mixed.h | 11 +++++++++++
 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 8a11d61220c..7bd9b5e1129 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 07e0c88e209..a777fb0d8a3 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,
 \f
 integral_table::integral_table ()
 {
-  set (MIN_EXPR, op_min);
   set (MAX_EXPR, op_max);
 }

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2023-06-12 15:32 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-06-12 15:32 [gcc r14-1724] Move operator_min to the unified range-op table Andrew Macleod

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).