bitmap.h (bitmap_and_compl_into): Return bool.

* bitmap.h (bitmap_and_compl_into): Return bool.
	* bitmap.c (bitmap_and_compl_into): Return changed flag.

From-SVN: r95004
This commit is contained in:
Nathan Sidwell 2005-02-14 09:24:41 +00:00 committed by Nathan Sidwell
parent be0f1e5478
commit 90bb1c1f15
3 changed files with 13 additions and 4 deletions

View File

@ -1,3 +1,8 @@
2005-02-13 Nathan Sidwell <nathan@codesourcery.com>
* bitmap.h (bitmap_and_compl_into): Return bool.
* bitmap.c (bitmap_and_compl_into): Return changed flag.
2005-02-13 James A. Morrison <phython@gcc.gnu.org>
PR tree-optimization/19944

View File

@ -700,14 +700,15 @@ bitmap_and_compl (bitmap dst, bitmap a, bitmap b)
dst->indx = dst->current->indx;
}
/* A &= ~B */
/* A &= ~B. Returns true if A changes */
void
bool
bitmap_and_compl_into (bitmap a, bitmap b)
{
bitmap_element *a_elt = a->first;
bitmap_element *b_elt = b->first;
bitmap_element *next;
BITMAP_WORD changed = 0;
gcc_assert (a != b);
while (a_elt && b_elt)
@ -724,9 +725,11 @@ bitmap_and_compl_into (bitmap a, bitmap b)
for (ix = BITMAP_ELEMENT_WORDS; ix--;)
{
BITMAP_WORD r = a_elt->bits[ix] & ~b_elt->bits[ix];
BITMAP_WORD cleared = a_elt->bits[ix] & b_elt->bits[ix];
BITMAP_WORD r = a_elt->bits[ix] ^ cleared;
a_elt->bits[ix] = r;
changed |= cleared;
ior |= r;
}
next = a_elt->next;
@ -738,6 +741,7 @@ bitmap_and_compl_into (bitmap a, bitmap b)
}
gcc_assert (!a->current == !a->first);
gcc_assert (!a->current || a->indx == a->current->indx);
return changed != 0;
}
/* DST = A | B. Return true if DST changes. */

View File

@ -102,7 +102,7 @@ extern bool bitmap_intersect_compl_p (bitmap, bitmap);
extern void bitmap_and (bitmap, bitmap, bitmap);
extern void bitmap_and_into (bitmap, bitmap);
extern void bitmap_and_compl (bitmap, bitmap, bitmap);
extern void bitmap_and_compl_into (bitmap, bitmap);
extern bool bitmap_and_compl_into (bitmap, bitmap);
extern bool bitmap_ior (bitmap, bitmap, bitmap);
extern bool bitmap_ior_into (bitmap, bitmap);
extern void bitmap_xor (bitmap, bitmap, bitmap);