This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[patch] Remove unused macro and functions from tree-flow.h and tree-flow-inline.h


Whilst poking around, I discovered these hast table functions and the macro are no longer used anywhere in the compiler.
bootstraps on x86_64-unknown-linux-gnu.
Probably obvious but in case I missed something...  OK?

Andrew

	* hash-table.h: Remove comment relating to deleted macro.
	* tree-flow-inline.h (first_htab_element, end_htab_p,
	next_htab_element): Delete unused functions.
	* tree-flow.h (FOR_EACH_HTAB_ELEMENT): Delete unused macro.


Index: hash-table.h
===================================================================
*** hash-table.h	(revision 202414)
--- hash-table.h	(working copy)
*************** hash_table <Descriptor, Allocator>::end
*** 1050,1059 ****
  
  /* Iterate through the elements of hash_table HTAB,
     using hash_table <....>::iterator ITER,
!    storing each element in RESULT, which is of type TYPE.
! 
!    This macro has this form for compatibility with the
!    FOR_EACH_HTAB_ELEMENT currently defined in tree-flow.h.  */
  
  #define FOR_EACH_HASH_TABLE_ELEMENT(HTAB, RESULT, TYPE, ITER) \
    for ((ITER) = (HTAB).begin (); \
--- 1050,1056 ----
  
  /* Iterate through the elements of hash_table HTAB,
     using hash_table <....>::iterator ITER,
!    storing each element in RESULT, which is of type TYPE.  */
  
  #define FOR_EACH_HASH_TABLE_ELEMENT(HTAB, RESULT, TYPE, ITER) \
    for ((ITER) = (HTAB).begin (); \
Index: tree-flow-inline.h
===================================================================
*** tree-flow-inline.h	(revision 202414)
--- tree-flow-inline.h	(working copy)
*************** gimple_vop (const struct function *fun)
*** 42,92 ****
    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
--- 42,47 ----
Index: tree-flow.h
===================================================================
*** tree-flow.h	(revision 202414)
--- tree-flow.h	(working copy)
*************** typedef struct
*** 106,118 ****
    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)))
- 
  /*---------------------------------------------------------------------------
  		      Attributes for SSA_NAMEs.
  
--- 106,111 ----

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]