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]

[cp] Remove some unused functions


I found the functions below using `findstatic.pl', a script that
determines canditates for static functions.  Some of these have be
made static and some of aren't used at all.  Tested with a bootstrap
on i686-pc-linux-gnu.  Okay for mainline?

2004-11-23  Ben Elliston  <bje@au.ibm.com>

	* cp-tree.h (context_as_string): Remove extern.
	* error.c (context_as_string): Remove.

	* cp-tree.h (cp_type_qual_from_rid): Remove extern.
	* lex.c (cp_type_qual_from_rid): Remove.

	* cp-tree.h (do_poplevel): Remove extern.
	(check_multiple_declarators): Likewise.
	* semantics.c (do_poplevel): Make static.
	(check_multiple_declarators): Remove.

	* cp-tree.h (check_final_overrider): Remove extern.
	* search.c (check_final_overrider): Make static.

	* cp-tree.h (build_artificial_parm): Remove extern.
	* decl2.c (build_artificial_parm): Make static.

Index: cp-tree.h
===================================================================
RCS file: /home/bje/gcc-cvs/gcc/gcc/cp/cp-tree.h,v
retrieving revision 1.1070
diff -u -p -r1.1070 cp-tree.h
--- cp-tree.h	10 Nov 2004 17:34:47 -0000	1.1070
+++ cp-tree.h	23 Nov 2004 07:25:57 -0000
@@ -3831,7 +3827,6 @@ extern void check_default_args (tree);
 extern void mark_used (tree);
 extern void finish_static_data_member_decl (tree, tree, tree, int);
 extern tree cp_build_parm_decl (tree, tree);
-extern tree build_artificial_parm (tree, tree);
 extern tree get_guard (tree);
 extern tree get_guard_cond (tree);
 extern tree set_guard (tree);
@@ -3853,7 +3848,6 @@ extern void init_error				(void);
 extern const char *type_as_string		(tree, int);
 extern const char *decl_as_string		(tree, int);
 extern const char *expr_as_string		(tree, int);
-extern const char *context_as_string            (tree, int);
 extern const char *lang_decl_name		(tree, int);
 extern const char *language_to_string           (enum languages);
 extern const char *class_key_or_enum_as_string  (tree);
@@ -3923,7 +3916,6 @@ extern tree cxx_make_type			(enum tree_c
 extern tree make_aggr_type			(enum tree_code);
 extern void yyerror				(const char *);
 extern void yyhook				(int);
-extern int cp_type_qual_from_rid                (tree);
 extern bool cxx_init				(void);
 extern void cxx_finish (void);
 
@@ -4056,7 +4048,6 @@ extern tree binfo_for_vtable			(tree);
 extern tree binfo_from_vbase			(tree);
 extern tree binfo_for_vbase			(tree, tree);
 extern tree look_for_overrides_here		(tree, tree);
-extern int check_final_overrider		(tree, tree);
 #define dfs_skip_bases ((tree)1)
 extern tree dfs_walk_all (tree, tree (*) (tree, void *),
 			  tree (*) (tree, void *), void *);
@@ -4080,7 +4071,6 @@ extern void pop_to_parent_deferring_acce
 extern void perform_deferred_access_checks	(void);
 extern void perform_or_defer_access_check	(tree, tree);
 extern void init_cp_semantics                   (void);
-extern tree do_poplevel				(tree);
 extern void add_decl_expr			(tree);
 extern tree finish_expr_stmt                    (tree);
 extern tree begin_if_stmt                       (void);
@@ -4157,7 +4147,6 @@ extern void finish_template_decl        
 extern tree finish_template_type                (tree, tree, int);
 extern tree finish_base_specifier               (tree, tree, bool);
 extern void finish_member_declaration           (tree);
-extern void check_multiple_declarators          (void);
 extern void qualified_name_lookup_error		(tree, tree, tree);
 extern tree finish_id_expression                (tree, tree, tree,
 						 cp_id_kind *, tree *,
Index: error.c
===================================================================
RCS file: /home/bje/gcc-cvs/gcc/gcc/cp/error.c,v
retrieving revision 1.271
diff -u -p -r1.271 error.c
--- error.c	9 Nov 2004 10:12:35 -0000	1.271
+++ error.c	23 Nov 2004 07:25:58 -0000
@@ -1919,14 +1919,6 @@ decl_as_string (tree decl, int flags)
   return pp_formatted_text (cxx_pp);
 }
 
-const char *
-context_as_string (tree context, int flags)
-{
-  reinit_cxx_pp ();
-  dump_scope (context, flags);
-  return pp_formatted_text (cxx_pp);
-}
-
 /* Generate the three forms of printable names for cxx_printable_name.  */
 
 const char *
Index: lex.c
===================================================================
RCS file: /home/bje/gcc-cvs/gcc/gcc/cp/lex.c,v
retrieving revision 1.351
diff -u -p -r1.351 lex.c
--- lex.c	8 Nov 2004 14:47:57 -0000	1.351
+++ lex.c	23 Nov 2004 07:25:58 -0000
@@ -796,20 +796,3 @@ make_aggr_type (enum tree_code code)
 
   return t;
 }
-
-/* Return the type-qualifier corresponding to the identifier given by
-   RID.  */
-
-int
-cp_type_qual_from_rid (tree rid)
-{
-  if (rid == ridpointers[(int) RID_CONST])
-    return TYPE_QUAL_CONST;
-  else if (rid == ridpointers[(int) RID_VOLATILE])
-    return TYPE_QUAL_VOLATILE;
-  else if (rid == ridpointers[(int) RID_RESTRICT])
-    return TYPE_QUAL_RESTRICT;
-
-  gcc_unreachable ();
-  return TYPE_UNQUALIFIED;
-}
Index: semantics.c
===================================================================
RCS file: /home/bje/gcc-cvs/gcc/gcc/cp/semantics.c,v
retrieving revision 1.449
diff -u -p -r1.449 semantics.c
--- semantics.c	9 Nov 2004 10:12:43 -0000	1.449
+++ semantics.c	23 Nov 2004 07:25:59 -0000
@@ -401,7 +401,7 @@ anon_aggr_type_p (tree node)
 
 /* Finish a scope.  */
 
-tree
+static tree
 do_poplevel (tree stmt_list)
 {
   tree block = NULL;
@@ -2292,31 +2292,6 @@ finish_base_specifier (tree base, tree a
     }
 
   return result;
-}
-
-/* Called when multiple declarators are processed.  If that is not
-   permitted in this context, an error is issued.  */
-
-void
-check_multiple_declarators (void)
-{
-  /* [temp]
-     
-     In a template-declaration, explicit specialization, or explicit
-     instantiation the init-declarator-list in the declaration shall
-     contain at most one declarator.  
-
-     We don't just use PROCESSING_TEMPLATE_DECL for the first
-     condition since that would disallow the perfectly valid code, 
-     like `template <class T> struct S { int i, j; };'.  */
-  if (at_function_scope_p ())
-    /* It's OK to write `template <class T> void f() { int i, j;}'.  */
-    return;
-     
-  if (PROCESSING_REAL_TEMPLATE_DECL_P () 
-      || processing_explicit_instantiation
-      || processing_specialization)
-    error ("multiple declarators in template declaration");
 }
 
 /* Issue a diagnostic that NAME cannot be found in SCOPE.  DECL is
Index: search.c
===================================================================
RCS file: /home/bje/gcc-cvs/gcc/gcc/cp/search.c,v
retrieving revision 1.341
diff -u -p -r1.341 search.c
--- search.c	16 Nov 2004 10:00:11 -0000	1.341
+++ search.c	23 Nov 2004 07:26:00 -0000
@@ -1774,7 +1774,7 @@ dfs_walk_once_accessible (tree binfo, bo
 /* Check that virtual overrider OVERRIDER is acceptable for base function
    BASEFN. Issue diagnostic, and return zero, if unacceptable.  */
 
-int
+static int
 check_final_overrider (tree overrider, tree basefn)
 {
   tree over_type = TREE_TYPE (overrider);
Index: decl2.c
===================================================================
RCS file: /home/bje/gcc-cvs/gcc/gcc/cp/decl2.c,v
retrieving revision 1.757
diff -u -p -r1.757 decl2.c
--- decl2.c	12 Nov 2004 21:47:06 -0000	1.757
+++ decl2.c	23 Nov 2004 07:26:01 -0000
@@ -157,7 +157,7 @@ cp_build_parm_decl (tree name, tree type
 /* Returns a PARM_DECL for a parameter of the indicated TYPE, with the
    indicated NAME.  */
 
-tree
+static tree
 build_artificial_parm (tree name, tree type)
 {
   tree parm = cp_build_parm_decl (name, type);


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