[tree-ssa] Fix some fallout from sbitmap -> bitmap transition
Daniel Berlin
dberlin@dberlin.org
Sun Apr 27 01:16:00 GMT 2003
On Saturday, April 26, 2003, at 05:37 PM, Jan Vroonhof wrote:
>>> 2003-04-26 Jan Vroonhof <jan.vroonhof@ntlworld.com>
>>>
>>> * bitmap.h (EXECUTE_IF_SET_IN_BITMAP_CLEAR): New bitmap walking
>>> macro. Clear bit when iterating over it. Primitive initial
>>> implementation (does not free data block when it turns out to be
>>> empty after walk).
>>
>> If you are walking the entire bitmap, the whole thing is clear when
>> you
>> are done with it, and you can just use bitmap_clear (which will free
>> the elements) after the EXECUTE_IF_SET_IN_BITMAP call.
>
> In this particular case the bitmap is freed very soon afterwards
> anyway. I wasn't clear what to do for a generic macro. Should we cater
> for cases where the body sets bits in the loop that might have
> previously been cleared?
This is also possible, just make a "bitmap_compact" that runs
"bitmap_element_zerop" on each element, and removes the unused ones. If
you look in bitmap_clear_bit, you'll see it does something like this.
More information about the Gcc-patches
mailing list