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]

[patch} remove unused function


Hi,

This patch removes an unused function:

combine_parm_decls

A grep on mainline CVS shows that it is not used:

bash-2.04$ grep -r combine_parm_decls *
gcc/ch/ch-tree.h:extern tree combine_parm_decls                  PARAMS ((tree, tree, int));
gcc/ChangeLog.3:        (combine_parm_decls): Likewise.
gcc/ChangeLog.3:        (combine_parm_decls): Likewise.
gcc/ChangeLog.3:        store_parm_decls, combine_parm_decls): Likewise.
gcc/c-decl.c:combine_parm_decls (specparms, parmlist, void_at_end)
gcc/c-tree.h:extern tree combine_parm_decls                  PARAMS ((tree, tree, int));
bash-2.04$


Bootstrapped and tested (only for c,c++,f77,objc) without regressions.

Please apply the patch if ok.

jan

Changelog:
2001-06-24  Jan van Male  <jan.vanmale@fenk.wau.nl>
         * c-decl.c (combine_parm_decls): Unused, remove.
         * c-tree.h: Remove prototype for combine_parm_decls.
         

ch/Changelog:
2001-06-24  Jan van Male  <jan.vanmale@fenk.wau.nl>
         * ch-tree.h: Remove prototype for combine_parm_decls, unused 
         function.




Index: gcc/gcc/c-decl.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/c-decl.c,v
retrieving revision 1.232
diff -c -3 -p -r1.232 c-decl.c
*** c-decl.c	2001/06/12 12:15:43	1.232
--- c-decl.c	2001/06/24 09:58:12
*************** store_parm_decls ()
*** 6577,6725 ****
    cfun->x_dont_save_pending_sizes_p = 1;
  }
  
- /* SPECPARMS is an identifier list--a chain of TREE_LIST nodes
-    each with a parm name as the TREE_VALUE.  A null pointer as TREE_VALUE
-    stands for an ellipsis in the identifier list.
- 
-    PARMLIST is the data returned by get_parm_info for the
-    parmlist that follows the semicolon.
- 
-    We return a value of the same sort that get_parm_info returns,
-    except that it describes the combination of identifiers and parmlist.  */
- 
- tree
- combine_parm_decls (specparms, parmlist, void_at_end)
-      tree specparms, parmlist;
-      int void_at_end;
- {
-   register tree fndecl = current_function_decl;
-   register tree parm;
- 
-   tree parmdecls = TREE_PURPOSE (parmlist);
- 
-   /* This is a chain of any other decls that came in among the parm
-      declarations.  They were separated already by get_parm_info,
-      so we just need to keep them separate.  */
-   tree nonparms = TREE_VALUE (parmlist);
- 
-   tree types = 0;
- 
-   for (parm = parmdecls; parm; parm = TREE_CHAIN (parm))
-     DECL_WEAK (parm) = 0;
- 
-   for (parm = specparms; parm; parm = TREE_CHAIN (parm))
-     {
-       register tree tail, found = NULL;
- 
-       /* See if any of the parmdecls specifies this parm by name.  */
-       for (tail = parmdecls; tail; tail = TREE_CHAIN (tail))
- 	if (DECL_NAME (tail) == TREE_VALUE (parm))
- 	  {
- 	    found = tail;
- 	    break;
- 	  }
- 
-       /* If declaration already marked, we have a duplicate name.
- 	 Complain, and don't use this decl twice.   */
-       if (found && DECL_WEAK (found))
- 	{
- 	  error_with_decl (found, "multiple parameters named `%s'");
- 	  found = 0;
- 	}
- 
-       /* If the declaration says "void", complain and ignore it.  */
-       if (found && VOID_TYPE_P (TREE_TYPE (found)))
- 	{
- 	  error_with_decl (found, "parameter `%s' declared void");
- 	  TREE_TYPE (found) = integer_type_node;
- 	  DECL_ARG_TYPE (found) = integer_type_node;
- 	  layout_decl (found, 0);
- 	}
- 
-       /* Traditionally, a parm declared float is actually a double.  */
-       if (found && flag_traditional
- 	  && TYPE_MAIN_VARIANT (TREE_TYPE (found)) == float_type_node)
- 	{
- 	  TREE_TYPE (found) = double_type_node;
- 	  DECL_ARG_TYPE (found) = double_type_node;
- 	  layout_decl (found, 0);
- 	}
- 
-       /* If no declaration found, default to int.  */
-       if (!found)
- 	{
- 	  found = build_decl (PARM_DECL, TREE_VALUE (parm),
- 			      integer_type_node);
- 	  DECL_ARG_TYPE (found) = TREE_TYPE (found);
- 	  DECL_SOURCE_LINE (found) = DECL_SOURCE_LINE (fndecl);
- 	  DECL_SOURCE_FILE (found) = DECL_SOURCE_FILE (fndecl);
- 	  error_with_decl (found, "type of parameter `%s' is not declared");
- 	  pushdecl (found);
- 	}
- 
-       TREE_PURPOSE (parm) = found;
- 
-       /* Mark this decl as "already found".  */
-       DECL_WEAK (found) = 1;
-     }
- 
-   /* Complain about any actual PARM_DECLs not matched with any names.  */
- 
-   for (parm = parmdecls; parm;)
-     {
-       tree next = TREE_CHAIN (parm);
-       TREE_CHAIN (parm) = 0;
- 
-       /* Complain about args with incomplete types.  */
-       if (!COMPLETE_TYPE_P (TREE_TYPE (parm)))
- 	{
- 	  error_with_decl (parm, "parameter `%s' has incomplete type");
- 	  TREE_TYPE (parm) = error_mark_node;
- 	}
- 
-       if (! DECL_WEAK (parm))
- 	{
- 	  error_with_decl (parm,
- 			   "declaration for parameter `%s' but no such parameter");
- 	  /* Pretend the parameter was not missing.
- 	     This gets us to a standard state and minimizes
- 	     further error messages.  */
- 	  specparms
- 	    = chainon (specparms,
- 		       tree_cons (parm, NULL_TREE, NULL_TREE));
- 	}
- 
-       parm = next;
-     }
- 
-   /* Chain the declarations together in the order of the list of names.
-      At the same time, build up a list of their types, in reverse order.  */
- 
-   parm = specparms;
-   parmdecls = 0;
-   {
-     register tree last;
-     for (last = 0; parm; parm = TREE_CHAIN (parm))
-       if (TREE_PURPOSE (parm))
- 	{
- 	  if (last == 0)
- 	    parmdecls = TREE_PURPOSE (parm);
- 	  else
- 	    TREE_CHAIN (last) = TREE_PURPOSE (parm);
- 	  last = TREE_PURPOSE (parm);
- 	  TREE_CHAIN (last) = 0;
- 
- 	  types = tree_cons (NULL_TREE, TREE_TYPE (parm), types);
- 	}
-   }
- 
-   if (void_at_end)
-     return tree_cons (parmdecls, nonparms,
- 		      nreverse (tree_cons (NULL_TREE, void_type_node, types)));
- 
-   return tree_cons (parmdecls, nonparms, nreverse (types));
- }
- 
  /* Finish up a function declaration and compile that function
     all the way to assembler language output.  The free the storage
     for the function definition.
--- 6577,6582 ----
Index: gcc/gcc/c-tree.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/c-tree.h,v
retrieving revision 1.62
diff -c -3 -p -r1.62 c-tree.h
*** c-tree.h	2001/06/05 06:51:02	1.62
--- c-tree.h	2001/06/24 09:58:12
*************** extern void c_mark_varargs              
*** 168,174 ****
  extern void check_for_loop_decls                PARAMS ((void));
  extern tree check_identifier                    PARAMS ((tree, tree));
  extern void clear_parm_order                    PARAMS ((void));
- extern tree combine_parm_decls                  PARAMS ((tree, tree, int));
  extern int  complete_array_type                 PARAMS ((tree, tree, int));
  extern void declare_parm_level                  PARAMS ((int));
  extern tree define_label                        PARAMS ((const char *, int,
--- 168,173 ----
Index: gcc/gcc/ch/ch-tree.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/ch/ch-tree.h,v
retrieving revision 1.24
diff -c -3 -p -r1.24 ch-tree.h
*** ch-tree.h	2001/05/26 01:31:35	1.24
--- ch-tree.h	2001/06/24 09:58:31
*************** extern tree c_build_type_variant        
*** 669,675 ****
  extern int  c_decode_option                     PARAMS ((int, char **));
  extern void c_mark_varargs                      PARAMS ((void));
  extern void clear_parm_order                    PARAMS ((void));
- extern tree combine_parm_decls                  PARAMS ((tree, tree, int));
  extern int  complete_array_type                 PARAMS ((tree, tree, int));
  extern void declare_parm_level                  PARAMS ((int));
  extern tree define_label                        PARAMS ((const char *, int, tree));
--- 669,674 ----


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