summaryrefslogtreecommitdiff
path: root/gcc/bitmap.c
diff options
context:
space:
mode:
authordberlin <dberlin@138bc75d-0d04-0410-961f-82ee72b054a4>2001-06-16 16:13:25 +0000
committerdberlin <dberlin@138bc75d-0d04-0410-961f-82ee72b054a4>2001-06-16 16:13:25 +0000
commit973b44934cfc63bb81d7b22f4a46df1cde3db162 (patch)
tree3a45f5c5fd147ad1c6593514ed6b6fb51ad056d2 /gcc/bitmap.c
parentdaf50c084cec2b5975efffb61c480ad21d923532 (diff)
downloadgcc-973b44934cfc63bb81d7b22f4a46df1cde3db162.tar.gz
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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@43420 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/bitmap.c')
-rw-r--r--gcc/bitmap.c38
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;
+}