diff mbox series

[COMMITTED] Merge irange::union/intersect into irange_union/intersect.

Message ID 20230501062906.564803-6-aldyh@redhat.com
State New
Headers show
Series [COMMITTED] Merge irange::union/intersect into irange_union/intersect. | expand

Commit Message

Aldy Hernandez May 1, 2023, 6:29 a.m. UTC
gcc/ChangeLog:

	* value-range.cc (irange::irange_union): Rename to...
	(irange::union_): ...this.
	(irange::irange_intersect): Rename to...
	(irange::intersect): ...this.
	* value-range.h (irange::union_): Delete.
	(irange::intersect): Delete.
---
 gcc/value-range.cc | 11 +++++++----
 gcc/value-range.h  | 14 --------------
 2 files changed, 7 insertions(+), 18 deletions(-)
diff mbox series

Patch

diff --git a/gcc/value-range.cc b/gcc/value-range.cc
index a0e49df28f3..69b214ecc06 100644
--- a/gcc/value-range.cc
+++ b/gcc/value-range.cc
@@ -1246,11 +1246,13 @@  irange::irange_single_pair_union (const irange &r)
   return true;
 }
 
-// union_ for multi-ranges.
+// Return TRUE if anything changes.
 
 bool
-irange::irange_union (const irange &r)
+irange::union_ (const vrange &v)
 {
+  const irange &r = as_a <irange> (v);
+
   if (r.undefined_p ())
     return false;
 
@@ -1415,11 +1417,12 @@  irange::irange_contains_p (const irange &r) const
 }
 
 
-// Intersect for multi-ranges.  Return TRUE if anything changes.
+// Return TRUE if anything changes.
 
 bool
-irange::irange_intersect (const irange &r)
+irange::intersect (const vrange &v)
 {
+  const irange &r = as_a <irange> (v);
   gcc_checking_assert (undefined_p () || r.undefined_p ()
 		       || range_compatible_p (type (), r.type ()));
 
diff --git a/gcc/value-range.h b/gcc/value-range.h
index 10c44c5c062..6d108154dc1 100644
--- a/gcc/value-range.h
+++ b/gcc/value-range.h
@@ -170,8 +170,6 @@  protected:
   irange (tree *, unsigned);
 
    // In-place operators.
-  bool irange_union (const irange &);
-  bool irange_intersect (const irange &);
   void irange_set (tree, tree);
   void irange_set_anti_range (tree, tree);
   bool irange_contains_p (const irange &) const;
@@ -903,18 +901,6 @@  irange::upper_bound () const
   return upper_bound (pairs - 1);
 }
 
-inline bool
-irange::union_ (const vrange &r)
-{
-  return irange_union (as_a <irange> (r));
-}
-
-inline bool
-irange::intersect (const vrange &r)
-{
-  return irange_intersect (as_a <irange> (r));
-}
-
 // Set value range VR to a nonzero range of type TYPE.
 
 inline void