X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=ir%2Fadt%2Fpset.h;h=ad1931c2724398139811f88912dc8568ab730309;hb=86f5b2fb5805caee806f8b1dd0ea3f6b41632586;hp=10549e815dcb1e54ffa4e2007b46c0c550528433;hpb=2e1e332fa1fd3a947c42decdd6acb22ca836f590;p=libfirm diff --git a/ir/adt/pset.h b/ir/adt/pset.h index 10549e815..ad1931c27 100644 --- a/ir/adt/pset.h +++ b/ir/adt/pset.h @@ -39,14 +39,12 @@ typedef struct pset pset; /* * Define some convenience macros using the predefined hash function. */ -#define pset_insert_ptr(set,key) pset_insert(set, key, HASH_PTR(key)) +#define pset_insert_ptr(set,key) pset_insert(set, key, HASH_PTR(key)) #define pset_hinsert_ptr(set,key) pset_hinsert(set, key, HASH_PTR(key)) -#define pset_remove_ptr(set,key) pset_remove(set, key, HASH_PTR(key)) -#define pset_find_ptr(set,key) pset_find(set, key, HASH_PTR(key)) -#define pset_new_ptr(slots) new_pset(pset_default_ptr_cmp, slots) -#define pset_new_ptr_default() pset_new_ptr(64) -void pset_insert_pset_ptr(pset *target, pset *src); /* Insertss all elements of src in target. */ - +#define pset_remove_ptr(set,key) pset_remove(set, key, HASH_PTR(key)) +#define pset_find_ptr(set,key) pset_find(set, key, HASH_PTR(key)) +#define pset_new_ptr(slots) new_pset(pset_default_ptr_cmp, slots) +#define pset_new_ptr_default() pset_new_ptr(64) /** The entry of a pset, representing an element pointer in the set and it's meta-information */ typedef struct { @@ -151,6 +149,7 @@ pset_entry *pset_hinsert (pset *pset, const void *key, unsigned hash); * * @remark * The current implementation did not allow to remove non-existing elements. + * @@@ so, does it do now? * Further, it is allowed to remove elements during an iteration * including the current one. */ @@ -184,6 +183,15 @@ void *pset_next (pset *pset); */ void pset_break (pset *pset); +/** + * Inserts all elements of the pointer set src into + * the set target (union). + * + * @param target the target set, will contain the union + * @param src a set, will not be changed + */ +void pset_insert_pset_ptr(pset *target, pset *src); + #define new_pset(cmp, slots) (PSET_TRACE (new_pset) ((cmp), (slots))) #define pset_find(pset, key, hash) \ _pset_search ((pset), (key), (hash), _pset_find)