[RFA]: decl_printable_name langhook

Neil Booth neil@daikokuya.demon.co.uk
Sun Mar 17 23:41:00 GMT 2002


Bootstrapped x86 Linux without regressions.  OK to apply?

Neil.

	* Makefile.in: Update.
	* c-common.c: Include langhooks.h.
	(inline_forbidden_p): Use new hook.
	* diagnostic.c: Include langhooks.h.
	(format_with_decl, announce_function,
	default_print_error_function): Use new hook.
	* dwarf2out.c (dwarf2_name): Use new hook.
	* function.c: Include langhooks.h.
	(init_function_start): Use new hook.
	* langhooks-def.h (lhd_decl_printable_name): New.
	(LANGHOOKS_DECL_PRINTABLE_NAME): New.
	(LANGHOOKS_INITIALIZER): Update.
	* langhooks.c (lhd_decl_printable_name): New.
	* langhooks.h (struct lang_hooks): New hook.
	* toplev.c (decl_name, decl_printable_name): Remove.
	(open_dump_file): Use new hook.
	(process_options): Remove old hook.
	* tree.h (decl_printable_name): Remove.
ada:
	* misc.c (LANG_HOOKS_DECL_PRINTABLE_NAME): Redefine.
	(nat_init): Remove old hook.
cp:
	* cp-lang.c (LANG_HOOKS_DECL_PRINTABLE_NAME): Redefine.
	* cp-tree.h (lang_printable_name): Rename.
	* error.c (lang_decl_name): Use new hook.
	* lex.c (cxx_init): Remove old hook.
	* pt.c (tsubst_decl): Use new hook.
	* tree.c (lang_printable_name): Rename.
f:
	* com.c (lang_printable_name): Rename.
	(LANG_HOOKS_DECL_PRINTABLE_NAME): Redefine.
	(ffe_init): Don't use old hook.
java:
	* decl.c (start_java_method): Use new hook.
	* lang.c (LANG_HOOKS_DECL_PRINTABLE_NAME): Redefine.
	(java_init): Remove old hook.
objc:
	* objc-act.c (objc_init): Remove old hook.
	(objc_printable_name): Export.
	* objc-act.h (objc_printable_name): New.
	* objc-lang.c (LANG_HOOKS_DECL_PRINTABLE_NAME): Redefine.

============================================================
Index: gcc/Makefile.in
--- gcc/Makefile.in	2002/03/15 07:09:36	1.839
+++ gcc/Makefile.in	2002/03/17 22:10:09
@@ -1160,7 +1160,7 @@ c-lex.o : c-lex.c $(CONFIG_H) $(SYSTEM_H
 c-objc-common.o : c-objc-common.c $(CONFIG_H) $(SYSTEM_H) $(TREE_H) \
     $(C_TREE_H) $(RTL_H) insn-config.h integrate.h $(EXPR_H) $(C_TREE_H) \
     flags.h toplev.h tree-inline.h diagnostic.h integrate.h $(VARRAY_H) \
-    $(GGC_H)
+    langhooks.h $(GGC_H)
 c-aux-info.o : c-aux-info.c  $(CONFIG_H) $(SYSTEM_H) $(TREE_H) $(C_TREE_H) \
     flags.h toplev.h
 c-convert.o : c-convert.c $(CONFIG_H) $(SYSTEM_H) $(TREE_H) flags.h toplev.h
@@ -1343,7 +1343,7 @@ fold-const.o : fold-const.c $(CONFIG_H) 
    toplev.h $(HASHTAB_H) $(EXPR_H) $(RTL_H) $(GGC_H) $(TM_P_H)
 diagnostic.o : diagnostic.c diagnostic.h real.h diagnostic.def \
    $(CONFIG_H) $(SYSTEM_H) $(TREE_H) $(TM_P_H) flags.h $(GGC_H) \
-   input.h toplev.h intl.h
+   input.h toplev.h intl.h langhooks.h
 toplev.o : toplev.c $(CONFIG_H) $(SYSTEM_H) $(TREE_H) $(RTL_H) function.h \
    flags.h xcoffout.h input.h $(INSN_ATTR_H) output.h diagnostic.h \
    debug.h insn-config.h intl.h $(RECOG_H) Makefile toplev.h \
@@ -1378,7 +1378,8 @@ varasm.o : varasm.c $(CONFIG_H) $(SYSTEM
    $(HASHTAB_H) $(TARGET_H) langhooks.h
 function.o : function.c $(CONFIG_H) $(SYSTEM_H) $(RTL_H) $(TREE_H) flags.h \
    function.h $(EXPR_H) libfuncs.h $(REGS_H) hard-reg-set.h \
-   insn-config.h $(RECOG_H) output.h toplev.h except.h hash.h $(GGC_H) $(TM_P_H)
+   insn-config.h $(RECOG_H) output.h toplev.h except.h hash.h $(GGC_H) \
+   $(TM_P_H) langhooks.h
 stmt.o : stmt.c $(CONFIG_H) $(SYSTEM_H) $(RTL_H) $(TREE_H) flags.h function.h  \
    insn-config.h hard-reg-set.h $(EXPR_H) libfuncs.h except.h \
    $(LOOP_H) $(RECOG_H) toplev.h output.h varray.h $(GGC_H) $(TM_P_H)
============================================================
Index: gcc/c-common.c
--- gcc/c-common.c	2002/03/15 20:08:23	1.298
+++ gcc/c-common.c	2002/03/17 22:10:16
@@ -37,6 +37,7 @@ Software Foundation, 59 Temple Place - S
 #include "c-lex.h"
 #include "cpplib.h"
 #include "target.h"
+#include "langhooks.h"
 cpp_reader *parse_in;		/* Declared in c-lex.h.  */
 
 #undef WCHAR_TYPE_SIZE
@@ -483,7 +484,7 @@ fname_as_string (pretty_p)
   
   if (pretty_p)
     name = (current_function_decl
-	    ? (*decl_printable_name) (current_function_decl, 2)
+	    ? (*lang_hooks.decl_printable_name) (current_function_decl, 2)
 	    : "top level");
   else if (current_function_decl && DECL_NAME (current_function_decl))
     name = IDENTIFIER_POINTER (DECL_NAME (current_function_decl));
============================================================
Index: gcc/c-objc-common.c
--- gcc/c-objc-common.c	2002/03/13 01:42:30	1.4
+++ gcc/c-objc-common.c	2002/03/17 22:10:18
@@ -33,6 +33,7 @@ Software Foundation, 59 Temple Place - S
 #include "tree-inline.h"
 #include "varray.h"
 #include "ggc.h"
+#include "langhooks.h"
 
 static int c_tree_printer PARAMS ((output_buffer *));
 static tree inline_forbidden_p PARAMS ((tree *, int *, void *));
@@ -392,7 +393,7 @@ c_tree_printer (buffer)
     case 'T':
       {
         const char *n = DECL_NAME (t)
-          ? (*decl_printable_name) (t, 2)
+          ? (*lang_hooks.decl_printable_name) (t, 2)
           : "({anonymous})";
         output_add_string (buffer, n);
       }
============================================================
Index: gcc/diagnostic.c
--- gcc/diagnostic.c	2002/01/23 19:34:08	1.78
+++ gcc/diagnostic.c	2002/03/17 22:10:20
@@ -34,6 +34,7 @@ Software Foundation, 59 Temple Place - S
 #include "toplev.h"
 #include "intl.h"
 #include "diagnostic.h"
+#include "langhooks.h"
 
 #define obstack_chunk_alloc xmalloc
 #define obstack_chunk_free  free
@@ -867,7 +868,7 @@ format_with_decl (buffer, decl)
   if (*p == '%')		/* Print the name.  */
     {
       const char *const n = (DECL_NAME (decl)
-			     ? (*decl_printable_name) (decl, 2)
+			     ? (*lang_hooks.decl_printable_name) (decl, 2)
 			     : _("((anonymous))"));
       output_add_string (buffer, n);
       while (*p)
@@ -1075,7 +1076,7 @@ announce_function (decl)
       if (rtl_dump_and_exit)
 	verbatim ("%s ", IDENTIFIER_POINTER (DECL_NAME (decl)));
       else
-        verbatim (" %s", (*decl_printable_name) (decl, 2));
+        verbatim (" %s", (*lang_hooks.decl_printable_name) (decl, 2));
       fflush (stderr);
       output_needs_newline (diagnostic_buffer) = 1;
       record_last_error_function ();
@@ -1105,11 +1106,11 @@ default_print_error_function (context, f
 	  if (TREE_CODE (TREE_TYPE (current_function_decl)) == METHOD_TYPE)
             output_printf
               ((output_buffer *) context, "In member function `%s':",
-               (*decl_printable_name) (current_function_decl, 2));
+               (*lang_hooks.decl_printable_name) (current_function_decl, 2));
 	  else
             output_printf
               ((output_buffer *) context, "In function `%s':",
-               (*decl_printable_name) (current_function_decl, 2));
+               (*lang_hooks.decl_printable_name) (current_function_decl, 2));
 	}
       output_add_newline ((output_buffer *) context);
 
============================================================
Index: gcc/dwarf2out.c
--- gcc/dwarf2out.c	2002/03/12 05:40:32	1.362
+++ gcc/dwarf2out.c	2002/03/17 22:10:53
@@ -6493,16 +6493,16 @@ output_comp_unit (die)
     unmark_dies (die);
 }
 
-/* The DWARF2 pubname for a nested thingy looks like "A::f".  The output
-   of decl_printable_name for C++ looks like "A::f(int)".  Let's drop the
-   argument list, and maybe the scope.  */
+/* The DWARF2 pubname for a nested thingy looks like "A::f".  The
+   output of lang_hooks.decl_printable_name for C++ looks like
+   "A::f(int)".  Let's drop the argument list, and maybe the scope.  */
 
 static const char *
 dwarf2_name (decl, scope)
      tree decl;
      int scope;
 {
-  return (*decl_printable_name) (decl, scope ? 1 : 0);
+  return (*lang_hooks.decl_printable_name) (decl, scope ? 1 : 0);
 }
 
 /* Add a new entry to .debug_pubnames if appropriate.  */
============================================================
Index: gcc/function.c
--- gcc/function.c	2002/03/13 06:10:23	1.350
+++ gcc/function.c	2002/03/17 22:11:05
@@ -59,6 +59,7 @@ Software Foundation, 59 Temple Place - S
 #include "ggc.h"
 #include "tm_p.h"
 #include "integrate.h"
+#include "langhooks.h"
 
 #ifndef TRAMPOLINE_ALIGNMENT
 #define TRAMPOLINE_ALIGNMENT FUNCTION_BOUNDARY
@@ -6259,7 +6260,7 @@ init_function_start (subr, filename, lin
 {
   prepare_function_start ();
 
-  current_function_name = (*decl_printable_name) (subr, 2);
+  current_function_name = (*lang_hooks.decl_printable_name) (subr, 2);
   cfun->decl = subr;
 
   /* Nonzero if this is a nested function that uses a static chain.  */
============================================================
Index: gcc/langhooks-def.h
--- gcc/langhooks-def.h	2002/03/17 20:41:35	1.11
+++ gcc/langhooks-def.h	2002/03/17 22:11:05
@@ -46,6 +46,7 @@ extern int lhd_safe_from_p PARAMS ((rtx,
 extern int lhd_staticp PARAMS ((tree));
 extern void lhd_clear_binding_stack PARAMS ((void));
 extern void lhd_print_tree_nothing PARAMS ((FILE *, tree, int));
+extern const char *lhd_decl_printable_name PARAMS ((tree, int));
 extern void lhd_set_yydebug PARAMS ((int));
 
 /* Declarations of default tree inlining hooks.  */
@@ -85,6 +86,7 @@ void lhd_tree_inlining_end_inlining		PAR
 #define LANG_HOOKS_PRINT_DECL		lhd_print_tree_nothing
 #define LANG_HOOKS_PRINT_TYPE		lhd_print_tree_nothing
 #define LANG_HOOKS_PRINT_IDENTIFIER	lhd_print_tree_nothing
+#define LANG_HOOKS_DECL_PRINTABLE_NAME	lhd_decl_printable_name
 #define LANG_HOOKS_SET_YYDEBUG		lhd_set_yydebug
 
 /* Tree inlining hooks.  */
@@ -156,6 +158,7 @@ int lhd_tree_dump_type_quals			PARAMS ((
   LANG_HOOKS_PRINT_DECL, \
   LANG_HOOKS_PRINT_TYPE, \
   LANG_HOOKS_PRINT_IDENTIFIER, \
+  LANG_HOOKS_DECL_PRINTABLE_NAME, \
   LANG_HOOKS_SET_YYDEBUG, \
   LANG_HOOKS_TREE_INLINING_INITIALIZER, \
   LANG_HOOKS_TREE_DUMP_INITIALIZER \
============================================================
Index: gcc/langhooks.c
--- gcc/langhooks.c	2002/02/28 07:39:24	1.17
+++ gcc/langhooks.c	2002/03/17 22:11:06
@@ -134,6 +134,16 @@ hook_get_alias_set_0 (t)
   return 0;
 }
 
+/* This is the default decl_printable_name function.  */
+
+const char *
+lhd_decl_printable_name (decl, verbosity)
+     tree decl;
+     int verbosity ATTRIBUTE_UNUSED;
+{
+  return IDENTIFIER_POINTER (DECL_NAME (decl));
+}
+
 /* lang_hooks.tree_inlining.walk_subtrees is called by walk_tree()
    after handling common cases, but before walking code-specific
    sub-trees.  If this hook is overridden for a language, it should
============================================================
Index: gcc/langhooks.h
--- gcc/langhooks.h	2002/03/17 20:41:35	1.18
+++ gcc/langhooks.h	2002/03/17 22:11:06
@@ -157,6 +157,14 @@ struct lang_hooks
   lang_print_tree_hook print_type;
   lang_print_tree_hook print_identifier;
 
+  /* Computes the name to use to print a declaration.  DECL is the
+     non-NULL declaration in question.  VERBOSITY determines what
+     information will be printed: 0: DECL_NAME, demangled as
+     necessary.  1: and scope information.  2: and any other
+     information that might be interesting, such as function parameter
+     types in C++.  */
+  const char *(*decl_printable_name) PARAMS ((tree decl, int verbosity));
+
   /* Set yydebug for bison-based parsers, when -dy is given on the
      command line.  By default, if the parameter is non-zero, prints a
      warning that the front end does not use such a parser.  */
============================================================
Index: gcc/toplev.c
--- gcc/toplev.c	2002/03/17 20:41:35	1.597
+++ gcc/toplev.c	2002/03/17 22:11:19
@@ -108,7 +108,6 @@ static void init_asm_output PARAMS ((con
 static void finalize PARAMS ((void));
 
 static void set_target_switch PARAMS ((const char *));
-static const char *decl_name PARAMS ((tree, int));
 
 static void float_signal PARAMS ((int)) ATTRIBUTE_NORETURN;
 static void crash_signal PARAMS ((int)) ATTRIBUTE_NORETURN;
@@ -353,16 +352,6 @@ tree current_function_decl;
    if none.  */
 tree current_function_func_begin_label;
 
-/* Pointer to function to compute the name to use to print a declaration.
-   DECL is the declaration in question.
-   VERBOSITY determines what information will be printed:
-     0: DECL_NAME, demangled as necessary.
-     1: and scope information.
-     2: and any other information that might be interesting, such as function
-        parameter types in C++.  */
-
-const char *(*decl_printable_name)	PARAMS ((tree, int));
-
 /* Pointer to function to compute rtl for a language-specific tree code.  */
 
 typedef rtx (*lang_expand_expr_t)
@@ -1559,19 +1548,7 @@ read_integral_parameter (p, pname, defva
 
   return atoi (p);
 }
-
 
-/* This is the default decl_printable_name function.  */
-
-static const char *
-decl_name (decl, verbosity)
-     tree decl;
-     int verbosity ATTRIBUTE_UNUSED;
-{
-  return IDENTIFIER_POINTER (DECL_NAME (decl));
-}
-
-
 /* This calls abort and is used to avoid problems when abort if a macro.
    It is used when we need to pass the address of abort.  */
 
@@ -1829,7 +1806,7 @@ open_dump_file (index, decl)
 
   if (decl)
     fprintf (rtl_dump_file, "\n;; Function %s\n\n",
-	     decl_printable_name (decl, 2));
+	     (*lang_hooks.decl_printable_name) (decl, 2));
 
   timevar_pop (TV_DUMP);
   return 1;
@@ -5002,7 +4979,6 @@ process_options ()
 static void
 lang_independent_init ()
 {
-  decl_printable_name = decl_name;
   lang_expand_expr = (lang_expand_expr_t) do_abort;
 
   /* Initialize the garbage-collector, and string pools.  */
============================================================
Index: gcc/tree.h
--- gcc/tree.h	2002/03/17 20:41:36	1.315
+++ gcc/tree.h	2002/03/17 22:11:28
@@ -2713,16 +2713,6 @@ extern tree current_function_func_begin_
 
 extern int all_types_permanent;
 
-/* Pointer to function to compute the name to use to print a declaration.
-   DECL is the declaration in question.
-   VERBOSITY determines what information will be printed:
-     0: DECL_NAME, demangled as necessary.
-     1: and scope information.
-     2: and any other information that might be interesting, such as function
-        parameter types in C++.  */
-
-extern const char *(*decl_printable_name)	PARAMS ((tree, int));
-
 /* Pointer to function to finish handling an incomplete decl at the
    end of compilation.  */
 
============================================================
Index: gcc/ada/misc.c
--- gcc/ada/misc.c	2002/03/17 20:41:39	1.23
+++ gcc/ada/misc.c	2002/03/17 22:11:30
@@ -109,6 +109,8 @@ static void gnat_parse_file		PARAMS ((vo
 #define LANG_HOOKS_PRINT_DECL		gnat_print_decl
 #undef LANG_HOOKS_PRINT_TYPE
 #define LANG_HOOKS_PRINT_TYPE		gnat_print_type
+#undef LANG_HOOKS_DECL_PRINTABLE_NAME
+#define LANG_HOOKS_DECL_PRINTABLE_NAME	gnat_printable_name
 
 const struct lang_hooks lang_hooks = LANG_HOOKS_INITIALIZER;
 
@@ -358,7 +360,6 @@ gnat_init (filename)
      it, but it's where g++ does it.  */
 
   lang_expand_expr = gnat_expand_expr;
-  decl_printable_name = gnat_printable_name;
 
   gnat_init_decl_processing ();
 
============================================================
Index: gcc/cp/cp-lang.c
--- gcc/cp/cp-lang.c	2002/03/17 20:41:42	1.14
+++ gcc/cp/cp-lang.c	2002/03/17 22:11:30
@@ -67,6 +67,8 @@ static bool ok_to_generate_alias_set_for
 #define LANG_HOOKS_PRINT_TYPE cxx_print_type
 #undef LANG_HOOKS_PRINT_IDENTIFIER
 #define LANG_HOOKS_PRINT_IDENTIFIER cxx_print_identifier
+#undef LANG_HOOKS_DECL_PRINTABLE_NAME
+#define LANG_HOOKS_DECL_PRINTABLE_NAME	cxx_printable_name
 #undef LANG_HOOKS_SET_YYDEBUG
 #define LANG_HOOKS_SET_YYDEBUG cxx_set_yydebug
 
============================================================
Index: gcc/cp/cp-tree.h
--- gcc/cp/cp-tree.h	2002/03/16 18:30:11	1.691
+++ gcc/cp/cp-tree.h	2002/03/17 22:11:45
@@ -4262,7 +4262,7 @@ extern tree build_overload              
 extern tree function_arg_chain			PARAMS ((tree));
 extern int promotes_to_aggr_type		PARAMS ((tree, enum tree_code));
 extern int is_aggr_type_2			PARAMS ((tree, tree));
-extern const char *lang_printable_name		PARAMS ((tree, int));
+extern const char *cxx_printable_name		PARAMS ((tree, int));
 extern tree build_exception_variant		PARAMS ((tree, tree));
 extern tree bind_template_template_parm		PARAMS ((tree, tree));
 extern tree array_type_nelts_total		PARAMS ((tree));
============================================================
Index: gcc/cp/error.c
--- gcc/cp/error.c	2002/02/05 01:46:01	1.170
+++ gcc/cp/error.c	2002/03/17 22:11:48
@@ -2132,7 +2132,7 @@ context_as_string (context, flags)
   return output_finalize_message (scratch_buffer);
 }
 
-/* Generate the three forms of printable names for lang_printable_name.  */
+/* Generate the three forms of printable names for cxx_printable_name.  */
 
 const char *
 lang_decl_name (decl, v)
@@ -2436,7 +2436,7 @@ cp_print_error_function (buffer, dc)
       else
         output_printf
           (buffer, "In %s `%s':", function_category (current_function_decl),
-           (*decl_printable_name) (current_function_decl, 2));
+           cxx_printable_name (current_function_decl, 2));
       output_add_newline (buffer);
 
       record_last_error_function ();
============================================================
Index: gcc/cp/lex.c
--- gcc/cp/lex.c	2002/03/16 18:30:13	1.269
+++ gcc/cp/lex.c	2002/03/17 22:11:51
@@ -642,7 +642,6 @@ const char *
 cxx_init (filename)
      const char *filename;
 {
-  decl_printable_name = lang_printable_name;
   input_filename = "<internal>";
 
   init_reswords ();
============================================================
Index: gcc/cp/pt.c
--- gcc/cp/pt.c	2002/03/16 18:30:13	1.579
+++ gcc/cp/pt.c	2002/03/17 22:12:14
@@ -6067,7 +6067,7 @@ tsubst_decl (t, args, type, complain)
 	/* For __PRETTY_FUNCTION__ we have to adjust the initializer.  */
 	if (DECL_PRETTY_FUNCTION_P (r))
 	  {
-	    const char *const name = (*decl_printable_name)
+	    const char *const name = cxx_printable_name
 	      			(current_function_decl, 2);
 	    DECL_INITIAL (r) = cp_fname_init (name);
 	    TREE_TYPE (r) = TREE_TYPE (DECL_INITIAL (r));
============================================================
Index: gcc/cp/tree.c
--- gcc/cp/tree.c	2002/03/15 20:08:36	1.271
+++ gcc/cp/tree.c	2002/03/17 22:12:18
@@ -1049,7 +1049,7 @@ cp_statement_code_p (code)
 #define PRINT_RING_SIZE 4
 
 const char *
-lang_printable_name (decl, v)
+cxx_printable_name (decl, v)
      tree decl;
      int v;
 {
============================================================
Index: gcc/f/com.c
--- gcc/f/com.c	2002/03/17 20:41:44	1.158
+++ gcc/f/com.c	2002/03/17 22:12:49
@@ -364,7 +364,7 @@ static void delete_block (tree block);
 static int duplicate_decls (tree newdecl, tree olddecl);
 static void finish_decl (tree decl, tree init, bool is_top_level);
 static void finish_function (int nested);
-static const char *lang_printable_name (tree decl, int v);
+static const char *ffe_printable_name (tree decl, int v);
 static tree lookup_name_current_level (tree name);
 static struct binding_level *make_binding_level (void);
 static void pop_f_function_context (void);
@@ -13630,7 +13630,7 @@ finish_function (int nested)
    nested function and all).  */
 
 static const char *
-lang_printable_name (tree decl, int v)
+ffe_printable_name (tree decl, int v)
 {
   /* Just to keep GCC quiet about the unused variable.
      In theory, differing values of V should produce different
@@ -14215,6 +14215,8 @@ static void ffe_print_identifier PARAMS 
 #define LANG_HOOKS_PARSE_FILE		ffe_parse_file
 #undef  LANG_HOOKS_PRINT_IDENTIFIER
 #define LANG_HOOKS_PRINT_IDENTIFIER	ffe_print_identifier
+#undef  LANG_HOOKS_DECL_PRINTABLE_NAME
+#define LANG_HOOKS_DECL_PRINTABLE_NAME	ffe_printable_name
 
 /* We do not wish to use alias-set based aliasing at all.  Used in the
    extreme (every object with its own set, with equivalences recorded) it
@@ -14277,7 +14279,6 @@ ffe_init (filename)
 #endif
 
   ffecom_init_decl_processing ();
-  decl_printable_name = lang_printable_name;
   print_error_function = lang_print_error_function;
 
   /* If the file is output from cpp, it should contain a first line
============================================================
Index: gcc/java/decl.c
--- gcc/java/decl.c	2002/03/10 03:53:14	1.121
+++ gcc/java/decl.c	2002/03/17 22:12:53
@@ -1775,7 +1775,7 @@ start_java_method (fndecl)
   type_map = (tree *) xrealloc (type_map, i * sizeof (tree));
 
 #if defined(DEBUG_JAVA_BINDING_LEVELS)
-  fprintf (stderr, "%s:\n", (*decl_printable_name) (fndecl, 2));
+  fprintf (stderr, "%s:\n", lang_printable_name (fndecl, 2));
   current_pc = 0;
 #endif /* defined(DEBUG_JAVA_BINDING_LEVELS) */
   pushlevel (1);  /* Push parameters. */
============================================================
Index: gcc/java/lang.c
--- gcc/java/lang.c	2002/03/17 20:41:45	1.90
+++ gcc/java/lang.c	2002/03/17 22:12:55
@@ -225,6 +225,8 @@ static int dependency_tracking = 0;
 #define LANG_HOOKS_PARSE_FILE java_parse_file
 #undef LANG_HOOKS_DUP_LANG_SPECIFIC_DECL
 #define LANG_HOOKS_DUP_LANG_SPECIFIC_DECL java_dup_lang_specific_decl
+#undef LANG_HOOKS_DECL_PRINTABLE_NAME
+#define LANG_HOOKS_DECL_PRINTABLE_NAME lang_printable_name
 
 /* Each front end provides its own.  */
 const struct lang_hooks lang_hooks = LANG_HOOKS_INITIALIZER;
@@ -506,7 +508,6 @@ java_init (filename)
   jcf_path_init ();
   jcf_path_seal (version_flag);
 
-  decl_printable_name = lang_printable_name;
   print_error_function = lang_print_error;
   lang_expand_expr = java_lang_expand_expr;
 
============================================================
Index: gcc/objc/objc-act.c
--- gcc/objc/objc-act.c	2002/03/13 01:42:43	1.129
+++ gcc/objc/objc-act.c	2002/03/17 22:13:09
@@ -165,7 +165,6 @@ static int check_methods_accessible		PAR
 static void encode_aggregate_within		PARAMS ((tree, int, int,
 					               int, int));
 static const char *objc_demangle		PARAMS ((const char *));
-static const char *objc_printable_name		PARAMS ((tree, int));
 static void objc_expand_function_end            PARAMS ((void));
 
 /* Hash tables to manage the global pool of method prototypes.  */
@@ -477,8 +476,6 @@ objc_init (filename)
 {
   filename = c_objc_common_init (filename);
 
-  decl_printable_name = objc_printable_name;
-
   /* Force the line number back to 0; check_newline will have
      raised it to 1, which will make the builtin functions appear
      not to be built in.  */
@@ -8028,7 +8025,7 @@ objc_demangle (mangled)
     return mangled;             /* not an objc mangled name */
 }
 
-static const char *
+const char *
 objc_printable_name (decl, kind)
      tree decl;
      int kind ATTRIBUTE_UNUSED;
============================================================
Index: gcc/objc/objc-act.h
--- gcc/objc/objc-act.h	2001/12/04 00:25:20	1.8
+++ gcc/objc/objc-act.h	2002/03/17 22:13:10
@@ -25,6 +25,7 @@ Boston, MA 02111-1307, USA.  */
 
 const char *objc_init				PARAMS ((const char *));
 int objc_decode_option				PARAMS ((int, char **));
+const char *objc_printable_name			PARAMS ((tree, int));
 
 /* used by yyparse */
 
============================================================
Index: gcc/objc/objc-lang.c
--- gcc/objc/objc-lang.c	2002/03/17 20:41:46	1.5
+++ gcc/objc/objc-lang.c	2002/03/17 22:13:10
@@ -52,6 +52,8 @@ static void objc_post_options           
 #define LANG_HOOKS_DUP_LANG_SPECIFIC_DECL c_dup_lang_specific_decl
 #undef LANG_HOOKS_PRINT_IDENTIFIER
 #define LANG_HOOKS_PRINT_IDENTIFIER c_print_identifier
+#undef LANG_HOOKS_DECL_PRINTABLE_NAME
+#define LANG_HOOKS_DECL_PRINTABLE_NAME objc_printable_name
 #undef LANG_HOOKS_SET_YYDEBUG
 #define LANG_HOOKS_SET_YYDEBUG c_set_yydebug
 /* Inlining hooks same as the C front end.  */



More information about the Gcc-patches mailing list