]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
Makefile.in: Update.
authorNeil Booth <neil@daikokuya.demon.co.uk>
Wed, 20 Mar 2002 07:58:41 +0000 (07:58 +0000)
committerNeil Booth <neil@gcc.gnu.org>
Wed, 20 Mar 2002 07:58:41 +0000 (07:58 +0000)
* 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.
(gnat_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_expr): 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.

From-SVN: r51066

29 files changed:
gcc/ChangeLog
gcc/Makefile.in
gcc/ada/ChangeLog
gcc/ada/misc.c
gcc/c-common.c
gcc/c-objc-common.c
gcc/cp/ChangeLog
gcc/cp/cp-lang.c
gcc/cp/cp-tree.h
gcc/cp/error.c
gcc/cp/lex.c
gcc/cp/pt.c
gcc/cp/tree.c
gcc/diagnostic.c
gcc/dwarf2out.c
gcc/f/ChangeLog
gcc/f/com.c
gcc/function.c
gcc/java/ChangeLog
gcc/java/decl.c
gcc/java/lang.c
gcc/langhooks-def.h
gcc/langhooks.c
gcc/langhooks.h
gcc/objc/objc-act.c
gcc/objc/objc-act.h
gcc/objc/objc-lang.c
gcc/toplev.c
gcc/tree.h

index 82f99cd2bda11255c9dfb28a3f3ff29c414be84b..9cf4c2aa34ecdd7311b6e761b296f5f213cd2ca8 100644 (file)
@@ -1,3 +1,29 @@
+2002-03-20  Neil Booth  <neil@daikokuya.demon.co.uk>
+
+       * 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.
+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.
+
 2002-03-19  Jim Blandy  <jimb@redhat.com>
 
        * c-lex.c (cb_file_change): Pass the #inclusion's line number to
index 69bc57d35087f672a0706b238c53aa57d1b1d2b9..2f967dfe0b131bd0be3c9d855763a4e82d0699bf 100644 (file)
@@ -1157,7 +1157,7 @@ c-lex.o : c-lex.c $(CONFIG_H) $(SYSTEM_H) $(TREE_H) $(RTL_H) c-lex.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
@@ -1340,7 +1340,7 @@ fold-const.o : fold-const.c $(CONFIG_H) $(SYSTEM_H) $(TREE_H) flags.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 \
@@ -1375,7 +1375,8 @@ varasm.o : varasm.c $(CONFIG_H) $(SYSTEM_H) $(TREE_H) $(RTL_H) flags.h \
    $(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 9b062a7c0b844947db5b46ff8803ee953d688aad..4512729f4c7a8b271ee44cf03990647d912e2557 100644 (file)
@@ -1,3 +1,8 @@
+2002-03-20  Neil Booth  <neil@daikokuya.demon.co.uk>
+
+       * misc.c (LANG_HOOKS_DECL_PRINTABLE_NAME): Redefine.
+       (gnat_init): Remove old hook.
+
 2002-03-17  Neil Booth  <neil@daikokuya.demon.co.uk>
 
        * misc.c (LANG_HOOKS_PARSE_FILE): Redefine.
index 46e280213593009cb12a40e6e87f36a6819d1bde..7073c8969f0effdb81c59f3127162df80bf568b3 100644 (file)
@@ -109,6 +109,8 @@ static void gnat_parse_file         PARAMS ((void));
 #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 4b2350e8cc42e1ea006a8f9646bb13266d74a8d8..91f2a20476b1812dda720f9a0806698a18725c9a 100644 (file)
@@ -37,6 +37,7 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
 #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 3baa0835e2343c6dfd1b1c2fd194ed9f2c64e535..7e6ecad26715494f242d564281eb54b7fdcefdb4 100644 (file)
@@ -33,6 +33,7 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
 #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 4d3e30949627e5b4004c51fd870762ceb213b50e..7dd27a413ffd2d9e89c58c271050fad2bccbf2f5 100644 (file)
@@ -1,3 +1,12 @@
+2002-03-20  Neil Booth  <neil@daikokuya.demon.co.uk>
+
+       * 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.
+
 2002-03-18  Eric Botcazou  <ebotcazou@multimania.com>
 
        PR c++/3882
index 40defa57e9525b60e0a1265b768f0ed67b02641e..619e4f06ff824867be32c766c2b411c717969b73 100644 (file)
@@ -67,6 +67,8 @@ static bool ok_to_generate_alias_set_for_type PARAMS ((tree));
 #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 6da6811ef4504f173ee1e03d1cb06cdf4ec069e2..35e1da9d9f53dd9a2248d0f9b2e8a4dbf67cefde 100644 (file)
@@ -4263,7 +4263,7 @@ extern tree build_overload                      PARAMS ((tree, tree));
 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 d4b1ff859a2dc7fe9b7d112b729e93ad5231846f..20352e01b54191874dc0b7326cbc5d2a3c163bfc 100644 (file)
@@ -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 7290a360db6b09f77cf48ff211cdaf5a3cd81f61..593f3121474df51c3bcc5b37ffba56b82696cef5 100644 (file)
@@ -642,7 +642,6 @@ const char *
 cxx_init (filename)
      const char *filename;
 {
-  decl_printable_name = lang_printable_name;
   input_filename = "<internal>";
 
   init_reswords ();
index 67da22daa9a9a988e11c07fa65a59621266a7143..e1b6c375113757e80a776806f86e56a9b80b1ce3 100644 (file)
@@ -7364,7 +7364,7 @@ tsubst_expr (t, args, complain, in_decl)
                    /* For __PRETTY_FUNCTION__ we have to adjust the
                       initializer.  */
                    const char *const name
-                     = (*decl_printable_name) (current_function_decl, 2);
+                     = cxx_printable_name (current_function_decl, 2);
                    init = cp_fname_init (name);
                    TREE_TYPE (decl) = TREE_TYPE (init);
                  }
index 1d99df02965d60525a20639df9453ba157d085d9..c547209d943621a286e725dc5930f42cce7015f8 100644 (file)
@@ -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 4ff157d7ecb0ca47a61eb61952333358303a9256..7cb9c9bbea79541a4326f055e1bccb4b0495cd5f 100644 (file)
@@ -34,6 +34,7 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
 #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, file)
          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 19b3c4647c2d360f9ca60cd2642c94682b20c892..3528bc8ed21920763d82ef0a461219065efb6c01 100644 (file)
@@ -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 5423463608df2f4b9fcad29d6ff72f35c3965c7a..690a4ee5d5eb8e8510c7cef8df9c44002fc727d7 100644 (file)
@@ -1,3 +1,9 @@
+Wed Mar 20 08:03:42 2002  Neil Booth  <neil@daikokuya.demon.co.uk>
+
+       * com.c (lang_printable_name): Rename.
+       (LANG_HOOKS_DECL_PRINTABLE_NAME): Redefine.
+       (ffe_init): Don't use old hook.
+
 Sun Mar 17 18:50:15 2002  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
 
        * com.h (ffe_parse_file): Prototype.
index 016b422db256eedc458189ddb58b87fb4fa78dd6..fa64b99ce941dd058386ce483f37e0290e085a62 100644 (file)
@@ -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 ((FILE *, tree, int));
 #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 b451eefcc893757c24341ca6282d9b0928ecdac8..e7facd453b7de26a3618cbdc28ce283a4b49da60 100644 (file)
@@ -59,6 +59,7 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
 #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, line)
 {
   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 efdbde5d0f93f6fb895cf76cb3dc1c03a5b2fe19..dc59c8323dbdf988c8cf88beae94d045ee1b7029 100644 (file)
@@ -1,3 +1,9 @@
+2002-03-20  Neil Booth  <neil@daikokuya.demon.co.uk>
+
+       * decl.c (start_java_method): Use new hook.
+       * lang.c (LANG_HOOKS_DECL_PRINTABLE_NAME): Redefine.
+       (java_init): Remove old hook.
+
 2002-03-18  Alexandre Petit-Bianco  <apbianco@redhat.com>
 
        * builtins.c (define_builtin): Do nothing if `type' is null.
index ddba14ff274da0fcd131930913fc732b1e183b32..ffcccb282299c7c34b3b80a0e244b0e9106686ec 100644 (file)
@@ -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 d9e5847a63efb8ce727a277ee91c95d962bad2b1..c612b491b4aa1ad541a906e2bae44e56686fb41c 100644 (file)
@@ -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 abd28471f8ffbde78a29f397cd2f3443c4e94b49..404b4bc3689baf1a63fef30be60b854d4cc07f24 100644 (file)
@@ -46,6 +46,7 @@ extern int lhd_safe_from_p PARAMS ((rtx, tree));
 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.  */
@@ -86,6 +87,7 @@ tree lhd_tree_inlining_convert_parm_for_inlining PARAMS ((tree, tree, tree));
 #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.  */
@@ -160,6 +162,7 @@ int lhd_tree_dump_type_quals                        PARAMS ((tree));
   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 6be5304a3285777d3e1ce9a076e02e62ed243fb8..cd36889a3225112d0fc8de8ecf4cec45ff1def11 100644 (file)
@@ -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 902bb55bc8c9bfdf64ea9372122b8bd090014ca9..49c2c6803a1f45d9b4832e6e9d71310ef7731e19 100644 (file)
@@ -160,6 +160,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 0c9e9fd27f808fc90e4f43655b69d298e8c386e2..2d689a25eb8e66533ff37cfb3e5ed048300b365f 100644 (file)
@@ -165,7 +165,6 @@ static int check_methods_accessible         PARAMS ((tree, tree,
 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 72b8b3e34b9261f9ac30e8531662019ab110e563..b4917f7a9e46186e9c3c1f16ee2117d8b69bd8d5 100644 (file)
@@ -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 d779e69d24703ca734690922c33c4077496945e7..2be19df95230acb327ca80e51d046867490fcd33 100644 (file)
@@ -52,6 +52,8 @@ static void objc_post_options                   PARAMS ((void));
 #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.  */
index a99fdd1af19aa98fe0b9fa82af69cc55add34076..134541734ccb0f92d87091f6bb6153b5b3e0fdc1 100644 (file)
@@ -108,7 +108,6 @@ static void init_asm_output PARAMS ((const char *));
 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, defval)
 
   return atoi (p);
 }
-
 \f
-/* 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));
-}
-\f
-
 /* 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 d9ad985f342acb5c0632d4cac0e092890b240706..6c03df798ccb10f3e8edf1fd084efb478abff380 100644 (file)
@@ -2713,16 +2713,6 @@ extern tree current_function_func_begin_label;
 
 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.  */