From: Aldy Hernandez Date: Fri, 2 Oct 2020 08:36:17 +0000 (+0200) Subject: Implement irange::fits_p. X-Git-Tag: basepoints/gcc-12~4648 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6a0423c52ef56d6fc2e0392b91bf22941fdeb0db;p=thirdparty%2Fgcc.git Implement irange::fits_p. 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. gcc/ChangeLog: * value-range.h (irange::fits_p): New. --- diff --git a/gcc/value-range.h b/gcc/value-range.h index c875e713d652..94b48e55e778 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.