gcc
* tree-flow.h (htab_iterator, FOR_EACH_HTAB_ELEMENT): Move from here.
* tree-flow-inline.h (first_htab_element, end_htab_p,
next_htab_element): Also move from here.
include
* hashtab.h (htab_iterator, HTAB_FOR_EACH_ELEMENT, htab_first_element,
htab_next_element): Rename and move to here.
(htab_end_p): Rename, move and change boolean to int and 0/1.
===================================================================
*************** struct GTY(()) gimple_df {
htab_t GTY ((param_is (struct tm_restart_node))) tm_restart;
};
-
- typedef struct
- {
- htab_t htab;
- PTR *slot;
- PTR *limit;
- } htab_iterator;
-
- /* Iterate through the elements of hashtable HTAB, using htab_iterator ITER,
- storing each element in RESULT, which is of type TYPE. */
- #define FOR_EACH_HTAB_ELEMENT(HTAB, RESULT, TYPE, ITER) \
- for (RESULT = (TYPE) first_htab_element (&(ITER), (HTAB)); \
- !end_htab_p (&(ITER)); \
- RESULT = (TYPE) next_htab_element (&(ITER)))
-
static inline int get_lineno (const_gimple);
/*---------------------------------------------------------------------------
===================================================================
*************** gimple_vop (const struct function *fun)
return fun->gimple_df->vop;
}
- /* Initialize the hashtable iterator HTI to point to hashtable TABLE */
-
- static inline void *
- first_htab_element (htab_iterator *hti, htab_t table)
- {
- hti->htab = table;
- hti->slot = table->entries;
- hti->limit = hti->slot + htab_size (table);
- do
- {
- PTR x = *(hti->slot);
- if (x != HTAB_EMPTY_ENTRY && x != HTAB_DELETED_ENTRY)
- break;
- } while (++(hti->slot) < hti->limit);
-
- if (hti->slot < hti->limit)
- return *(hti->slot);
- return NULL;
- }
-
- /* Return current non-empty/deleted slot of the hashtable pointed to by HTI,
- or NULL if we have reached the end. */
-
- static inline bool
- end_htab_p (const htab_iterator *hti)
- {
- if (hti->slot >= hti->limit)
- return true;
- return false;
- }
-
- /* Advance the hashtable iterator pointed to by HTI to the next element of the
- hashtable. */
-
- static inline void *
- next_htab_element (htab_iterator *hti)
- {
- while (++(hti->slot) < hti->limit)
- {
- PTR x = *(hti->slot);
- if (x != HTAB_EMPTY_ENTRY && x != HTAB_DELETED_ENTRY)
- return x;
- };
- return NULL;
- }
-
/* Get the number of the next statement uid to be allocated. */
static inline unsigned int
gimple_stmt_max_uid (struct function *fn)
===================================================================
*************** extern hashval_t iterative_hash (const v
/* Shorthand for hashing something with an intrinsic size. */
#define iterative_hash_object(OB,INIT) iterative_hash (&OB, sizeof (OB), INIT)
+ /* GCC style hash table iterator. */
+
+ typedef struct
+ {
+ htab_t htab;
+ PTR *slot;
+ PTR *limit;
+ } htab_iterator;
+
+ /* Iterate through the elements of hashtable HTAB, using htab_iterator ITER,
+ storing each element in RESULT, which is of type TYPE. */
+ #define HTAB_FOR_EACH_ELEMENT(HTAB, RESULT, TYPE, ITER) \
+ for (RESULT = (TYPE) htab_first_element (&(ITER), (HTAB)); \
+ !htab_end_p (&(ITER)); \
+ RESULT = (TYPE) htab_next_element (&(ITER)))
+
+ /* Initialize the hashtable iterator HTI to point to hashtable TABLE */
+
+ static inline void *
+ htab_first_element (htab_iterator *hti, htab_t table)
+ {
+ hti->htab = table;
+ hti->slot = table->entries;
+ hti->limit = hti->slot + htab_size (table);
+ do
+ {
+ PTR x = *(hti->slot);
+ if (x != HTAB_EMPTY_ENTRY && x != HTAB_DELETED_ENTRY)
+ break;
+ } while (++(hti->slot) < hti->limit);
+
+ if (hti->slot < hti->limit)
+ return *(hti->slot);
+ return NULL;
+ }
+
+ /* Return current non-empty/deleted slot of the hashtable pointed to by HTI,
+ or NULL if we have reached the end. */
+
+ static inline int
+ htab_end_p (const htab_iterator *hti)
+ {
+ if (hti->slot >= hti->limit)
+ return 1;
+ return 0;
+ }
+
+ /* Advance the hashtable iterator pointed to by HTI to the next element of the
+ hashtable. */
+
+ static inline void *
+ htab_next_element (htab_iterator *hti)
+ {
+ while (++(hti->slot) < hti->limit)
+ {
+ PTR x = *(hti->slot);
+ if (x != HTAB_EMPTY_ENTRY && x != HTAB_DELETED_ENTRY)
+ return x;
+ };
+ return NULL;
+ }
+
#ifdef __cplusplus
}
#endif /* __cplusplus */