diff options
author | crowl <crowl@138bc75d-0d04-0410-961f-82ee72b054a4> | 2012-11-01 21:02:15 +0000 |
---|---|---|
committer | crowl <crowl@138bc75d-0d04-0410-961f-82ee72b054a4> | 2012-11-01 21:02:15 +0000 |
commit | 0d21196387a8566f0b98f35adc355932393b670e (patch) | |
tree | 6a2b07bcbe69d6025168367c7ef581e376cca84c /gcc/ebitmap.c | |
parent | 41f4033b94a7a17e766e29386542f087ae0e2dfa (diff) | |
download | gcc-0d21196387a8566f0b98f35adc355932393b670e.tar.gz |
This patch renames sbitmap iterators to unify them with the bitmap iterators.
Remove the unused EXECUTE_IF_SET_IN_SBITMAP_REV, which has an unconventional
interface.
Rename the sbitmap_iter_* functions to match bitmap's bmp_iter_* functions.
Add an additional parameter to the initialization and next functions to
match the interface in bmp_iter_*. This extra parameter is mostly hidden
by the use of the EXECUTE_IF macros.
Rename the EXECUTE_IF_SET_IN_SBITMAP macro to EXECUTE_IF_SET_IN_BITMAP. Its
implementation is now identical to that in bitmap.h. To prevent redefinition
errors, both definitions are now guarded by #ifndef. An alternate strategy
is to simply include bitmap.h from sbitmap.h. As this would increase build
time, I have elected to use the #ifndef version. I do not have a strong
preference here.
The sbitmap_iterator type is still distinctly named because it is often
declared in contexts where the bitmap type is not obvious. There are less
than 40 uses of this type, so the burden to modify it when changing bitmap
types is not large.
Tested on x86-64, config-list.mk testing.
Index: gcc/ChangeLog
2012-10-31 Lawrence Crowl <crowl@google.com>
* sbitmap.h (sbitmap_iter_init): Rename bmp_iter_set_init and add
unused parameter to match bitmap iterator. Update callers.
(sbitmap_iter_cond): Rename bmp_iter_set. Update callers.
(sbitmap_iter_next): Rename bmp_iter_next and add unused parameter to
match bitmap iterator. Update callers.
(EXECUTE_IF_SET_IN_SBITMAP_REV): Remove unused.
(EXECUTE_IF_SET_IN_SBITMAP): Rename EXECUTE_IF_SET_IN_BITMAP and
adjust to be identical to the definition in bitmap.h. Conditionalize
the definition based on not having been defined. Update callers.
* bitmap.h (EXECUTE_IF_SET_IN_BITMAP): Conditionalize the definition
based on not having been defined. (To match the above.)
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@193069 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/ebitmap.c')
-rw-r--r-- | gcc/ebitmap.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/gcc/ebitmap.c b/gcc/ebitmap.c index 8f2e9a687f2..334953204e3 100644 --- a/gcc/ebitmap.c +++ b/gcc/ebitmap.c @@ -438,7 +438,7 @@ bitmap_and_into (ebitmap dst, ebitmap src) the result, AND'ing them. */ bitmap_and (dst->wordmask, dst->wordmask, src->wordmask); - EXECUTE_IF_SET_IN_SBITMAP (dst->wordmask, 0, i, sbi) + EXECUTE_IF_SET_IN_BITMAP (dst->wordmask, 0, i, sbi) { EBITMAP_ELT_TYPE tmpword = ebitmap_array_get (src, srceltindex++); tmpword &= ebitmap_array_get (dst, dsteltindex++); @@ -490,7 +490,7 @@ bitmap_and (ebitmap dst, ebitmap src1, ebitmap src2) 0); bitmap_and (dst->wordmask, src1->wordmask, src2->wordmask); - EXECUTE_IF_SET_IN_SBITMAP (dst->wordmask, 0, i, sbi) + EXECUTE_IF_SET_IN_BITMAP (dst->wordmask, 0, i, sbi) { bool src1hasword, src2hasword; @@ -598,7 +598,7 @@ bitmap_ior_into (ebitmap dst, ebitmap src) newarraysize = src->numwords + dst->numwords; newarray = XNEWVEC (EBITMAP_ELT_TYPE, newarraysize); - EXECUTE_IF_SET_IN_SBITMAP (tempmask, 0, i, sbi) + EXECUTE_IF_SET_IN_BITMAP (tempmask, 0, i, sbi) { bool dsthasword, srchasword; @@ -707,7 +707,7 @@ bitmap_ior (ebitmap dst, ebitmap src1, ebitmap src2) newarraysize = src1->numwords + src2->numwords; newarray = XNEWVEC (EBITMAP_ELT_TYPE, newarraysize); - EXECUTE_IF_SET_IN_SBITMAP (tempmask, 0, i, sbi) + EXECUTE_IF_SET_IN_BITMAP (tempmask, 0, i, sbi) { bool src1hasword, src2hasword; EBITMAP_ELT_TYPE tmpword; @@ -803,7 +803,7 @@ bitmap_and_compl_into (ebitmap dst, ebitmap src) if (src->numwords == 0) return false; - EXECUTE_IF_SET_IN_SBITMAP (dst->wordmask, 0, i, sbi) + EXECUTE_IF_SET_IN_BITMAP (dst->wordmask, 0, i, sbi) { bool srchasword; @@ -886,7 +886,7 @@ bitmap_and_compl (ebitmap dst, ebitmap src1, ebitmap src2) newarraysize = src1->numwords; newarray = XNEWVEC (EBITMAP_ELT_TYPE, newarraysize); - EXECUTE_IF_SET_IN_SBITMAP (src1->wordmask, 0, i, sbi) + EXECUTE_IF_SET_IN_BITMAP (src1->wordmask, 0, i, sbi) { bool src2hasword; EBITMAP_ELT_TYPE tmpword; |