diff options
Diffstat (limited to 'gcc/sbitmap.c')
-rw-r--r-- | gcc/sbitmap.c | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/gcc/sbitmap.c b/gcc/sbitmap.c index 4cc7c85f5c1..dece5e5ef25 100644 --- a/gcc/sbitmap.c +++ b/gcc/sbitmap.c @@ -265,6 +265,25 @@ sbitmap_a_or_b (dst, a, b) } return changed; } +/* Return non-zero if A is a subset of B. */ + +int +sbitmap_a_subset_b_p (a, b) + sbitmap a, b; +{ + int i; + sbitmap_ptr ap, bp; + + ap = a->elms; + bp = b->elms; + for (i = 0; i < a->size; i++) + { + if ((*ap | *bp) != *bp) + return 0; + ap++; bp++; + } + return 1; +} /* Set DST to be (A or (B and C)). Return non-zero if any change is made. */ |