diff options
author | Daniel Berlin <dan@cgsoftware.com> | 2001-06-16 16:13:25 +0000 |
---|---|---|
committer | Daniel Berlin <dberlin@gcc.gnu.org> | 2001-06-16 16:13:25 +0000 |
commit | ea1939969e757b057b82adc1a51ee50330b5228f (patch) | |
tree | 3a45f5c5fd147ad1c6593514ed6b6fb51ad056d2 /gcc/bitmap.c | |
parent | 6d34c1c4f3cb9537b65a57ee9d6c80853ea0017a (diff) | |
download | gcc-ea1939969e757b057b82adc1a51ee50330b5228f.tar.gz |
bitmap.h: Add dump_bitmap...
2001-06-16 Daniel Berlin <dan@cgsoftware.com>
* bitmap.h: Add dump_bitmap, bitmap_zero, bitmap_union_of_diffs,
bitmap_a_or_b, bitmap_a_and_b, bitmap_first_set_bit,
bitmap_last_set_bit. All for compatibility with sbitmap's.
*bitmap.c (bitmap_zero): New function.
(bitmap_union_of_diffs): New function.
(bitmap_first_set_bit): New function.
(bitmap_last_set_bit): New function.
From-SVN: r43420
Diffstat (limited to 'gcc/bitmap.c')
-rw-r--r-- | gcc/bitmap.c | 38 |
1 files changed, 37 insertions, 1 deletions
diff --git a/gcc/bitmap.c b/gcc/bitmap.c index 56a5fd7b3b9..8521ab566fe 100644 --- a/gcc/bitmap.c +++ b/gcc/bitmap.c @@ -507,7 +507,9 @@ bitmap_operation (to, from1, from2, operation) case BITMAP_IOR: DOIT (|); break; - + case BITMAP_IOR_COMPL: + DOIT (|~); + break; case BITMAP_XOR: DOIT (^); break; @@ -676,3 +678,37 @@ bitmap_release_memory () obstack_free (&bitmap_obstack, NULL); } } + +int +bitmap_union_of_diff (dst, a, b, c) + bitmap dst; + bitmap a; + bitmap b; + bitmap c; +{ + int changed = 0; + bitmap temp = BITMAP_ALLOCA (); + bitmap_operation (temp, b, c, BITMAP_AND_COMPL); + changed = bitmap_operation (dst, temp, a, BITMAP_IOR); + return changed; +} + +int +bitmap_first_set_bit (a) + bitmap a; +{ + int i; + EXECUTE_IF_SET_IN_BITMAP (a, 0, i, return i;); + return -1; +} + +int +bitmap_last_set_bit (a) + bitmap a; +{ + int i; + EXECUTE_IF_SET_IN_BITMAP (a, 0, i, ); + if (bitmap_bit_p (a, i)) + return i; + return -1; +} |