This patch adds the `bitmap_bit_in_range_p_1` helper function,
in order to be used by `bitmap_bit_in_range_p`. The helper function
contains the previous implementation of `bitmap_bit_in_range_p` and
`bitmap_bit_in_range_p` has been updated to call the helper function.

gcc/ChangeLog:

        * sbitmap.cc (bitmap_bit_in_range_p): Call `bitmap_bit_in_range_p_1`.
        (bitmap_bit_in_range_p_1): New function.

Signed-off-by: Konstantinos Eleftheriou <konstantinos.elefther...@vrull.eu>
---

(no changes since v1)

 gcc/sbitmap.cc | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)

diff --git a/gcc/sbitmap.cc b/gcc/sbitmap.cc
index df2e1aa49358..94f2bbd6c8fd 100644
--- a/gcc/sbitmap.cc
+++ b/gcc/sbitmap.cc
@@ -330,7 +330,8 @@ bitmap_set_range (sbitmap bmap, unsigned int start, 
unsigned int count)
    the simple bitmap BMAP.  Return FALSE otherwise.  */
 
 bool
-bitmap_bit_in_range_p (const_sbitmap bmap, unsigned int start, unsigned int 
end)
+bitmap_bit_in_range_p_1 (const_sbitmap bmap, unsigned int start,
+                        unsigned int end)
 {
   gcc_checking_assert (start <= end);
   bitmap_check_index (bmap, end);
@@ -375,6 +376,15 @@ bitmap_bit_in_range_p (const_sbitmap bmap, unsigned int 
start, unsigned int end)
   return (bmap->elms[start_word] & mask) != 0;
 }
 
+/* Return TRUE if any bit between START and END inclusive is set within
+   the simple bitmap BMAP.  Return FALSE otherwise.  */
+
+bool
+bitmap_bit_in_range_p (const_sbitmap bmap, unsigned int start, unsigned int 
end)
+{
+  return bitmap_bit_in_range_p_1 (bmap, start, end);
+}
+
 #if GCC_VERSION < 3400
 /* Table of number of set bits in a character, indexed by value of char.  */
 static const unsigned char popcount_table[] =
-- 
2.49.0

Reply via email to