compilers/imcc/sets.c
An implementation of sets -- used for tracking register usage.
Set *set_make
- Create a new Set object.
Set *set_make_full
- Create a new Set object and clear all bits.
void set_free
- Free memory allocated for the Set argument.
void set_clear
- Clear all bits in the Set argument.
Set *set_copy
- Copies the set
s
,
returning a new set pointer.
int set_equal
- Compares two sets for equality; sets are equal if they have the same elements.
void set_add
- Adds to set
s
the element element
.
unsigned int set_first_zero
- Sets the first unused item in the set.
int set_contains
- Check whether the specified element is present in the specified Set argument.
Returns 1 if it is,
0 otherwise.
Set *set_union
- Compute the union of the two Set arguments.
A new resulting Set object is returned.
- If the two Set arguments have different lengths,
a fatal error is raised.
Set *set_intersec
- Create a new Set object that is the intersection of the Set arguments.
Intersection is defined through the binary and operator.
- If the argument Sets don't have the same length,
a fatal error is raised.
void set_intersec_inplace
- See set_intersec,
except that the first argument Set is changed inplace; in other words,
the first Set argument becomes the result.