This should have been included in the irange_allocator patch, as a method to see if the current object can hold a passed range without truncation.

Pushed.

gcc/ChangeLog:

        * value-range.h (irange::fits_p): New.
---
 gcc/value-range.h | 1 +
 1 file changed, 1 insertion(+)

diff --git a/gcc/value-range.h b/gcc/value-range.h
index c875e713d65..94b48e55e77 100644
--- a/gcc/value-range.h
+++ b/gcc/value-range.h
@@ -81,6 +81,7 @@ public:
   bool operator!= (const irange &r) const { return !(*this == r); }

   // Misc methods.
+  bool fits_p (const irange &r) { return m_max_ranges >= r.num_pairs (); }
   void dump (FILE * = stderr) const;

   // Deprecated legacy public methods.
--
2.26.2

Reply via email to