diff options
author | 2004-12-09 21:00:10 -0700 | |
---|---|---|
committer | 2005-04-07 21:05:49 -0700 | |
commit | c3c27ec32ecff60cd07a5eea53ba2d48c3bae194 (patch) | |
tree | ddd0791cd8f0f6be1cb2488db3f6a130dd3971e9 /lib.h | |
parent | Be smarter about when we need to flush a pseudo. (diff) | |
download | sparse-c3c27ec32ecff60cd07a5eea53ba2d48c3bae194.tar.gz sparse-c3c27ec32ecff60cd07a5eea53ba2d48c3bae194.tar.bz2 sparse-c3c27ec32ecff60cd07a5eea53ba2d48c3bae194.zip |
Support tagged add_ptr_list
Diffstat (limited to 'lib.h')
-rw-r--r-- | lib.h | 11 |
1 files changed, 9 insertions, 2 deletions
@@ -91,7 +91,7 @@ void delete_ptr_list_entry(struct ptr_list **, void *, int); void replace_ptr_list_entry(struct ptr_list **, void *old, void *new, int); extern void sort_list(struct ptr_list **, int (*)(const void *, const void *)); -extern void **__add_ptr_list(struct ptr_list **, void *); +extern void **__add_ptr_list(struct ptr_list **, void *, unsigned long tag); extern void concat_ptr_list(struct ptr_list *a, struct ptr_list **b); extern void __free_ptr_list(struct ptr_list **); extern int ptr_list_size(struct ptr_list *); @@ -105,8 +105,10 @@ int linearize_ptr_list(struct ptr_list *, void **, int); * You just have to be creative, and use some gcc * extensions.. */ +#define add_ptr_list_tag(list,entry,tag) \ + (TYPEOF(*(list))) (CHECK_TYPE(*(list),(entry)),__add_ptr_list((struct ptr_list **)(list), (entry), (tag))) #define add_ptr_list(list,entry) \ - (TYPEOF(*(list))) (CHECK_TYPE(*(list),(entry)),__add_ptr_list((struct ptr_list **)(list), (entry))) + add_ptr_list_tag(list,entry,0) #define free_ptr_list(list) \ do { VRFY_PTR_LIST(*(list)); __free_ptr_list((struct ptr_list **)(list)); } while (0) @@ -416,6 +418,11 @@ static inline void update_tag(void *p, unsigned long tag) *ptr = tag | (~3UL & *ptr); } +static inline void *tag_ptr(void *ptr, unsigned long tag) +{ + return (void *)(tag | (unsigned long)ptr); +} + #define CURRENT_TAG(ptr) (3 & (unsigned long)*THIS_ADDRESS(ptr)) #define TAG_CURRENT(ptr,val) update_tag(THIS_ADDRESS(ptr),val) |