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] Make four functions in cp/typeck.c static


The following patch makes 4 functions in cp/typeck.c static
and removes their prototypes from cp/cp-tree.h.

In addition, the patch removes the macro PFN_FROM_PTRMEMFUNC
which is only a wrapper for pfn_from_ptrmemfunc. The only use
of PFN_FROM_PTRMEMFUNC is converted to pfn_from_ptrmemfunc
to match the other two calls of this function.

Bootstrapped and regtested on i686-pc-linux-gnu.

Ok for mainline?

Regards,
Volker


2005-01-25  Volker Reichelt  <reichelt@igpm.rwth-aachen.de>

	* cp-tree.h (commonparms): Remove prototype.
	(original_type): Likewise.
	(convert_arguments): Likewise.
	(pfn_from_ptrmemfunc): Likewise.
	(PFN_FROM_PTRMEMFUNC): Remove.
	* typeck.c (commonparms): Make static.
	(original_type): Likewise.
	(convert_arguments): Add prototype. Make static.
	(pfn_from_ptrmemfunc): Likewise.
	(get_member_function_from_ptrfunc): Replace
	PFN_FROM_PTRMEMFUNC by pfn_from_ptrmemfunc.

===================================================================
--- cp-tree.h	10 Jan 2005 19:37:05 -0000	1.1088
+++ cp-tree.h	25 Jan 2005 16:00:14 -0000
@@ -2535,8 +2535,6 @@ struct lang_decl GTY(())
       }									\
     TYPE_LANG_SPECIFIC (NODE)->u.ptrmem.record = (VALUE);		\
   } while (0)
-/* Returns the pfn field from a TYPE_PTRMEMFUNC_P.  */
-#define PFN_FROM_PTRMEMFUNC(NODE) pfn_from_ptrmemfunc ((NODE))
 
 /* For a pointer-to-member type of the form `T X::*', this is `X'.
    For a type like `void (X::*)() const', this type is `X', not `const
@@ -4305,8 +4303,6 @@ extern tree complete_type			(tree);
 extern tree complete_type_or_diagnostic         (tree, tree, int);
 #define complete_type_or_else(T,V) (complete_type_or_diagnostic ((T), (V), 0))
 extern int type_unknown_p			(tree);
-extern tree commonparms				(tree, tree);
-extern tree original_type			(tree);
 extern bool comp_except_specs			(tree, tree, bool);
 extern bool comptypes				(tree, tree, int);
 extern bool compparms				(tree, tree);
@@ -4324,7 +4320,6 @@ extern tree build_x_indirect_ref		(tree,
 extern tree build_indirect_ref			(tree, const char *);
 extern tree build_array_ref			(tree, tree);
 extern tree get_member_function_from_ptrfunc	(tree *, tree);
-extern tree convert_arguments			(tree, tree, tree, int);
 extern tree build_x_binary_op			(enum tree_code, tree, tree,
 						 bool *);
 extern tree build_x_unary_op			(enum tree_code, tree);
@@ -4350,7 +4345,6 @@ extern bool at_least_as_qualified_p     
 extern bool more_qualified_p                     (tree, tree);
 extern tree build_ptrmemfunc1                   (tree, tree, tree);
 extern void expand_ptrmemfunc_cst               (tree, tree *, tree *);
-extern tree pfn_from_ptrmemfunc                 (tree);
 extern tree type_after_usual_arithmetic_conversions (tree, tree);
 extern tree composite_pointer_type              (tree, tree, tree, tree,
 						       const char*);
===================================================================
--- typeck.c	22 Dec 2004 18:00:39 -0000	1.606
+++ typeck.c	25 Jan 2005 16:00:42 -0000
@@ -57,6 +57,8 @@ static void casts_away_constness_r (tree
 static bool casts_away_constness (tree, tree);
 static void maybe_warn_about_returning_address_of_local (tree);
 static tree lookup_destructor (tree, tree, tree);
+static tree convert_arguments (tree, tree, tree, int);
+static tree pfn_from_ptrmemfunc (tree);
 
 /* Return the target type of TYPE, which means return T for:
    T*, T&, T[], T (...), and otherwise, just T.  */
@@ -174,7 +176,7 @@ type_unknown_p (tree exp)
    As an optimization, free the space we allocate if the parameter
    lists are already common.  */
 
-tree
+static tree
 commonparms (tree p1, tree p2)
 {
   tree oldargs = p1, newargs, n;
@@ -235,7 +237,7 @@ commonparms (tree p1, tree p2)
 
 /* Given a type, perhaps copied for a typedef,
    find the "original" version of it.  */
-tree
+static tree
 original_type (tree t)
 {
   while (TYPE_NAME (t) != NULL_TREE)
@@ -2336,7 +2338,7 @@ get_member_function_from_ptrfunc (tree *
 	function = save_expr (function);
 
       /* Start by extracting all the information from the PMF itself.  */
-      e3 = PFN_FROM_PTRMEMFUNC (function);
+      e3 = pfn_from_ptrmemfunc (function);
       delta = build_ptrmemfunc_access_expr (function, delta_identifier);
       idx = build1 (NOP_EXPR, vtable_index_type, e3);
       switch (TARGET_PTRMEMFUNC_VBIT_LOCATION)
@@ -2504,7 +2506,7 @@ build_function_call (tree function, tree
    In C++, unspecified trailing parameters can be filled in with their
    default arguments, if such were specified.  Do so here.  */
 
-tree
+static tree
 convert_arguments (tree typelist, tree values, tree fndecl, int flags)
 {
   tree typetail, valtail;
@@ -5808,7 +5810,7 @@ expand_ptrmemfunc_cst (tree cst, tree *d
 /* Return an expression for PFN from the pointer-to-member function
    given by T.  */
 
-tree
+static tree
 pfn_from_ptrmemfunc (tree t)
 {
   if (TREE_CODE (t) == PTRMEM_CST)
===================================================================



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