* Makefile.in (integrate.o): Update.
authorneil <neil@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 28 Feb 2002 07:39:44 +0000 (07:39 +0000)
committerneil <neil@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 28 Feb 2002 07:39:44 +0000 (07:39 +0000)
* c-decl.c (copy_lang_decl): Rename.
* c-lang.c (LANG_HOOKS_DUP_LANG_SPECIFIC_DECL): Redefine.
* integrate.c: Include langhooks.h.
(copy_decl_for_inlining): Update to use langhook.
* langhooks-def.h (lhd_do_nothing_t,
LANG_HOOKS_DUP_LANG_SPECIFIC_DECL): New.
(LANG_HOOKS_INITIALIZER): Update.
* langhooks.c (lhd_do_nothing_t): New.
* langhooks.h (struct lang_hooks): Add dup_lang_specific_decl.
* tree.h (copy_lang_decl): Remove.
ada:
* misc.c (copy_lang_decl): Remove.
cp:
* class.c (build_clone): Update.
* cp-lang.c (LANG_HOOKS_DUP_LANG_SPECIFIC_DECL): Redefine.
* cp-tree.h (cxx_dup_lang_specific_decl): New.
* lex.c (copy_lang_decl): Rename cxx_dup_lang_specific_decl.
(copy_decl): Update.
* method.c (make_thunk): Update.
f:
* com.c (copy_lang_decl): Delete.
java:
* decl.c (copy_lang_decl): Rename java_dup_lang_specific_decl.
* java-tree.h (java_dup_lang_specific_decl): New.
* lang.c (LANG_HOOKS_DUP_LANG_SPECIFIC_DECL): Redefine.
objc:
* objc-lang.c (LANG_HOOKS_DUP_LANG_SPECIFIC_DECL): Redefine.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@50122 138bc75d-0d04-0410-961f-82ee72b054a4

25 files changed:
gcc/ChangeLog
gcc/Makefile.in
gcc/ada/ChangeLog
gcc/ada/misc.c
gcc/c-decl.c
gcc/c-lang.c
gcc/c-tree.h
gcc/cp/ChangeLog
gcc/cp/class.c
gcc/cp/cp-lang.c
gcc/cp/cp-tree.h
gcc/cp/lex.c
gcc/cp/method.c
gcc/f/ChangeLog
gcc/f/com.c
gcc/integrate.c
gcc/java/ChangeLog
gcc/java/decl.c
gcc/java/java-tree.h
gcc/java/lang.c
gcc/langhooks-def.h
gcc/langhooks.c
gcc/langhooks.h
gcc/objc/objc-lang.c
gcc/tree.h

index 1f9dd89..3074e4b 100644 (file)
@@ -1,3 +1,19 @@
+2002-02-28  Neil Booth  <neil@daikokuya.demon.co.uk>
+
+       * Makefile.in (integrate.o): Update.
+       * c-decl.c (copy_lang_decl): Rename.
+       * c-lang.c (LANG_HOOKS_DUP_LANG_SPECIFIC_DECL): Redefine.
+       * integrate.c: Include langhooks.h.
+       (copy_decl_for_inlining): Update to use langhook.
+       * langhooks-def.h (lhd_do_nothing_t,
+       LANG_HOOKS_DUP_LANG_SPECIFIC_DECL): New.
+       (LANG_HOOKS_INITIALIZER): Update.
+       * langhooks.c (lhd_do_nothing_t): New.
+       * langhooks.h (struct lang_hooks): Add dup_lang_specific_decl.
+       * tree.h (copy_lang_decl): Remove.
+objc:
+       * objc-lang.c (LANG_HOOKS_DUP_LANG_SPECIFIC_DECL): Redefine.
+
 2002-02-27  Andrew MacLeod  <amacleod@redhat.com>
 
        * dwarf2out.c (stack_adjust_offset): Add support for POST_INC, 
index a7f05d4..604dd7d 100644 (file)
@@ -1431,7 +1431,7 @@ real.o : real.c $(CONFIG_H) $(SYSTEM_H) $(TREE_H) toplev.h $(TM_P_H)
 integrate.o : integrate.c $(CONFIG_H) $(SYSTEM_H) $(RTL_H) $(TREE_H) flags.h \
    debug.h $(INTEGRATE_H) insn-config.h $(EXPR_H) real.h $(REGS_H) \
    intl.h function.h output.h $(RECOG_H) except.h toplev.h $(LOOP_H) \
-   $(PARAMS_H) $(TM_P_H) $(TARGET_H)
+   $(PARAMS_H) $(TM_P_H) $(TARGET_H) langhooks.h
 jump.o : jump.c $(CONFIG_H) $(SYSTEM_H) $(RTL_H) flags.h hard-reg-set.h $(REGS_H) \
    insn-config.h $(RECOG_H) $(EXPR_H) real.h except.h function.h \
    toplev.h $(INSN_ATTR_H) $(TM_P_H) reload.h $(PREDICT_H)
index 1443a90..875b3d5 100644 (file)
@@ -1,3 +1,7 @@
+2002-02-28  Neil Booth  <neil@daikokuya.demon.co.uk>
+
+       * misc.c (copy_lang_decl): Remove.
+
 2002-02-27  Zack Weinberg  <zack@codesourcery.com>
 
        * misc.c: Delete traditional-mode-related code copied from the
index c4da922..78b04c8 100644 (file)
@@ -6,7 +6,7 @@
  *                                                                          *
  *                           C Implementation File                          *
  *                                                                          *
- *                             $Revision: 1.17 $
+ *                             $Revision: 1.18 $
  *                                                                          *
  *          Copyright (C) 1992-2001 Free Software Foundation, Inc.          *
  *                                                                          *
@@ -406,15 +406,6 @@ maybe_build_cleanup (decl)
   return NULL_TREE;
 }
 
-/* integrate_decl_tree calls this function, but since we don't use the
-   DECL_LANG_SPECIFIC field, this is a no-op.  */
-
-void
-copy_lang_decl (node)
-     tree node ATTRIBUTE_UNUSED;
-{
-}
-
 /* Hooks for print-tree.c:  */
 
 static void
index 177bcea..21ff5ee 100644 (file)
@@ -7200,10 +7200,10 @@ mark_c_function_context (f)
   mark_binding_level (&p->binding_level);
 }
 
-/* Copy the DECL_LANG_SPECIFIC data associated with NODE.  */
+/* Copy the DECL_LANG_SPECIFIC data associated with DECL.  */
 
 void
-copy_lang_decl (decl)
+c_dup_lang_specific_decl (decl)
      tree decl;
 {
   struct lang_decl *ld;
index 497d32a..174f9dc 100644 (file)
@@ -55,6 +55,8 @@ static void c_post_options PARAMS ((void));
 #define LANG_HOOKS_PRINT_IDENTIFIER c_print_identifier
 #undef LANG_HOOKS_SET_YYDEBUG
 #define LANG_HOOKS_SET_YYDEBUG c_set_yydebug
+#undef LANG_HOOKS_DUP_LANG_SPECIFIC_DECL
+#define LANG_HOOKS_DUP_LANG_SPECIFIC_DECL c_dup_lang_specific_decl
 
 #undef LANG_HOOKS_TREE_INLINING_CANNOT_INLINE_TREE_FN
 #define LANG_HOOKS_TREE_INLINING_CANNOT_INLINE_TREE_FN \
index 064ee08..d6f622e 100644 (file)
@@ -168,6 +168,7 @@ extern void gen_aux_info_record                 PARAMS ((tree, int, int, int));
 
 /* in c-decl.c */
 extern void c_init_decl_processing             PARAMS ((void));
+extern void c_dup_lang_specific_decl           PARAMS ((tree));
 extern void c_print_identifier                 PARAMS ((FILE *, tree, int));
 extern tree build_array_declarator              PARAMS ((tree, tree, int, int));
 extern tree build_enumerator                    PARAMS ((tree, tree));
index d2c80e0..410479c 100644 (file)
@@ -1,3 +1,12 @@
+2002-02-28  Neil Booth  <neil@daikokuya.demon.co.uk>
+
+       * class.c (build_clone): Update.
+       * cp-lang.c (LANG_HOOKS_DUP_LANG_SPECIFIC_DECL): Redefine.
+       * cp-tree.h (cxx_dup_lang_specific_decl): New.
+       * lex.c (copy_lang_decl): Rename cxx_dup_lang_specific_decl.
+       (copy_decl): Update.
+       * method.c (make_thunk): Update.
+
 2002-02-27  Zack Weinberg  <zack@codesourcery.com>
 
        * decl2.c: Delete traditional-mode-related code copied from
index 4070286..9e3c110 100644 (file)
@@ -4038,7 +4038,7 @@ build_clone (fn, name)
       for (parms = DECL_ARGUMENTS (clone); parms; parms = TREE_CHAIN (parms))
        {
          DECL_CONTEXT (parms) = clone;
-         copy_lang_decl (parms);
+         cxx_dup_lang_specific_decl (parms);
        }
     }
 
index c40330b..800a870 100644 (file)
@@ -50,6 +50,8 @@ static HOST_WIDE_INT cxx_get_alias_set PARAMS ((tree));
 #define LANG_HOOKS_EXPAND_CONSTANT cplus_expand_constant
 #undef LANG_HOOKS_SAFE_FROM_P
 #define LANG_HOOKS_SAFE_FROM_P c_safe_from_p
+#undef LANG_HOOKS_DUP_LANG_SPECIFIC_DECL
+#define LANG_HOOKS_DUP_LANG_SPECIFIC_DECL cxx_dup_lang_specific_decl
 #undef LANG_HOOKS_PRINT_STATISTICS
 #define LANG_HOOKS_PRINT_STATISTICS cxx_print_statistics
 #undef LANG_HOOKS_PRINT_XNODE
index 6581132..73aed25 100644 (file)
@@ -3922,6 +3922,7 @@ extern tree build_java_class_ref                PARAMS ((tree));
 /* in input.c */
 
 /* in lex.c */
+extern void cxx_dup_lang_specific_decl         PARAMS ((tree));
 extern tree make_pointer_declarator            PARAMS ((tree, tree));
 extern tree make_reference_declarator          PARAMS ((tree, tree));
 extern tree make_call_declarator               PARAMS ((tree, tree, tree, tree));
index 885002a..d338632 100644 (file)
@@ -1516,7 +1516,7 @@ retrofit_lang_decl (t)
 }
 
 void
-copy_lang_decl (node)
+cxx_dup_lang_specific_decl (node)
      tree node;
 {
   int size;
@@ -1548,7 +1548,7 @@ copy_decl (decl)
   tree copy;
 
   copy = copy_node (decl);
-  copy_lang_decl (copy);
+  cxx_dup_lang_specific_decl (copy);
   return copy;
 }
 
index 52a6a8c..35e40eb 100644 (file)
@@ -302,7 +302,7 @@ make_thunk (function, delta, vcall_index)
     {
       thunk = build_decl (FUNCTION_DECL, thunk_id, TREE_TYPE (func_decl));
       DECL_LANG_SPECIFIC (thunk) = DECL_LANG_SPECIFIC (func_decl);
-      copy_lang_decl (func_decl);
+      cxx_dup_lang_specific_decl (func_decl);
       SET_DECL_ASSEMBLER_NAME (thunk, thunk_id);
       DECL_CONTEXT (thunk) = DECL_CONTEXT (func_decl);
       TREE_READONLY (thunk) = TREE_READONLY (func_decl);
index 3809a19..94cf691 100644 (file)
@@ -1,3 +1,7 @@
+Thu Feb 28 07:53:46 2002  Neil Booth  <neil@daikokuya.demon.co.uk>
+
+       * com.c (copy_lang_decl): Delete.
+
 2002-02-27  Zack Weinberg  <zack@codesourcery.com>
 
        * com.c, lex.c, top.c: Delete traditional-mode-related code
index 3c4a1d5..d1e769a 100644 (file)
@@ -14049,15 +14049,6 @@ convert (type, expr)
   return error_mark_node;
 }
 
-/* integrate_decl_tree calls this function, but since we don't use the
-   DECL_LANG_SPECIFIC field, this is a no-op.  */
-
-void
-copy_lang_decl (node)
-     tree node UNUSED;
-{
-}
-
 /* Return the list of declarations of the current level.
    Note that this list is in reverse order unless/until
    you nreverse it; and when you do nreverse it, you must
index ad6b2a1..59c1550 100644 (file)
@@ -43,6 +43,7 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
 #include "params.h"
 #include "ggc.h"
 #include "target.h"
+#include "langhooks.h"
 
 #include "obstack.h"
 #define        obstack_chunk_alloc     xmalloc
@@ -368,8 +369,7 @@ copy_decl_for_inlining (decl, from_fn, to_fn)
   else
     {
       copy = copy_node (decl);
-      if (DECL_LANG_SPECIFIC (copy))
-       copy_lang_decl (copy);
+      (*lang_hooks.dup_lang_specific_decl) (copy);
 
       /* TREE_ADDRESSABLE isn't used to indicate that a label's
         address has been taken; it's for internal bookkeeping in
index 4076a77..a4ef231 100644 (file)
@@ -1,3 +1,9 @@
+2002-02-28  Neil Booth  <neil@daikokuya.demon.co.uk>
+
+       * decl.c (copy_lang_decl): Rename java_dup_lang_specific_decl.
+       * java-tree.h (java_dup_lang_specific_decl): New.
+       * lang.c (LANG_HOOKS_DUP_LANG_SPECIFIC_DECL): Redefine.
+
 2002-02-27  Zack Weinberg  <zack@codesourcery.com>
 
        * builtins.c, decl.c: Delete traditional-mode-related code
index f9bbc9f..eaa7c48 100644 (file)
@@ -1543,13 +1543,20 @@ set_block (block)
 /* integrate_decl_tree calls this function. */
 
 void
-copy_lang_decl (node)
+java_dup_lang_specific_decl (node)
      tree node;
 {
-  int lang_decl_size
-    = TREE_CODE (node) == VAR_DECL ? sizeof (struct lang_decl_var)
-    : sizeof (struct lang_decl);
-  struct lang_decl *x = (struct lang_decl *) ggc_alloc (lang_decl_size);
+  int lang_decl_size;
+  struct lang_decl *x;
+
+  if (!DECL_LANG_SPECIFIC (node))
+    return;
+
+  if (TREE_CODE (node) == VAR_DECL)
+    lang_decl_size = sizeof (struct lang_decl_var);
+  else
+    lang_decl_size = sizeof (struct lang_decl);
+  x = (struct lang_decl *) ggc_alloc (lang_decl_size);
   memcpy (x, DECL_LANG_SPECIFIC (node), lang_decl_size);
   DECL_LANG_SPECIFIC (node) = x;
 }
index 8f64ef2..7097b56 100644 (file)
@@ -1069,6 +1069,7 @@ extern tree ident_subst PARAMS ((const char*, int,
 extern tree identifier_subst PARAMS ((const tree,
                                     const char *, int, int, const char *));
 extern void java_init_decl_processing PARAMS ((void));
+extern void java_dup_lang_specific_decl PARAMS ((tree));
 extern tree build_java_signature PARAMS ((tree));
 extern tree build_java_argument_signature PARAMS ((tree));
 extern void set_java_signature PARAMS ((tree, tree));
index 1520390..6be8f2b 100644 (file)
@@ -214,6 +214,8 @@ static int dependency_tracking = 0;
 #define LANG_HOOKS_DECODE_OPTION java_decode_option
 #undef LANG_HOOKS_SET_YYDEBUG
 #define LANG_HOOKS_SET_YYDEBUG java_set_yydebug
+#undef LANG_HOOKS_DUP_LANG_SPECIFIC_DECL
+#define LANG_HOOKS_DUP_LANG_SPECIFIC_DECL java_dup_lang_specific_decl
 
 /* Each front end provides its own.  */
 const struct lang_hooks lang_hooks = LANG_HOOKS_INITIALIZER;
index ca55a82..89002aa 100644 (file)
@@ -38,6 +38,7 @@ extern HOST_WIDE_INT hook_get_alias_set_0     PARAMS ((tree));
 /* See langhooks.h for the definition and documentation of each hook.  */
 
 extern void lhd_do_nothing PARAMS ((void));
+extern void lhd_do_nothing_t PARAMS ((tree));
 extern int lhd_decode_option PARAMS ((int, char **));
 extern HOST_WIDE_INT lhd_get_alias_set PARAMS ((tree));
 extern tree lhd_return_tree PARAMS ((tree));
@@ -75,6 +76,7 @@ void lhd_tree_inlining_end_inlining           PARAMS ((tree));
 #define LANG_HOOKS_EXPAND_CONSTANT     lhd_return_tree
 #define LANG_HOOKS_SAFE_FROM_P         lhd_safe_from_p
 #define LANG_HOOKS_STATICP             lhd_staticp
+#define LANG_HOOKS_DUP_LANG_SPECIFIC_DECL lhd_do_nothing_t
 #define LANG_HOOKS_HONOR_READONLY      false
 #define LANG_HOOKS_PRINT_STATISTICS    lhd_do_nothing
 #define LANG_HOOKS_PRINT_XNODE         lhd_print_tree_nothing
@@ -143,6 +145,7 @@ int lhd_tree_dump_type_quals                        PARAMS ((tree));
   LANG_HOOKS_EXPAND_CONSTANT, \
   LANG_HOOKS_SAFE_FROM_P, \
   LANG_HOOKS_STATICP, \
+  LANG_HOOKS_DUP_LANG_SPECIFIC_DECL, \
   LANG_HOOKS_HONOR_READONLY, \
   LANG_HOOKS_PRINT_STATISTICS, \
   LANG_HOOKS_PRINT_XNODE, \
index de5519c..a976d74 100644 (file)
@@ -39,6 +39,14 @@ lhd_do_nothing ()
 {
 }
 
+/* Do nothing.  */
+
+void
+lhd_do_nothing_t (t)
+     tree t ATTRIBUTE_UNUSED;
+{
+}
+
 /* Do nothing (return the tree node passed).  */
 
 tree
index 81ae71b..8203fd1 100644 (file)
@@ -128,6 +128,10 @@ struct lang_hooks
   /* Hook called by staticp for language-specific tree codes.  */
   int (*staticp) PARAMS ((tree));
 
+  /* Replace the DECL_LANG_SPECIFIC data, which may be NULL, of the
+     DECL_NODE with a newly GC-allocated copy.  */
+  void (*dup_lang_specific_decl) PARAMS ((tree));
+
   /* Nonzero if TYPE_READONLY and TREE_READONLY should always be honored.  */
   bool honor_readonly;
 
index 7e2cae7..8f155c2 100644 (file)
@@ -46,6 +46,8 @@ static void objc_post_options                   PARAMS ((void));
 #define LANG_HOOKS_POST_OPTIONS objc_post_options
 #undef LANG_HOOKS_STATICP
 #define LANG_HOOKS_STATICP c_staticp
+#undef LANG_HOOKS_DUP_LANG_SPECIFIC_DECL
+#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_SET_YYDEBUG
index 8e17b53..06d9815 100644 (file)
@@ -2859,9 +2859,6 @@ extern tree fold_builtin          PARAMS ((tree));
 \f
 /* The language front-end must define these functions.  */
 
-/* Function to replace the DECL_LANG_SPECIFIC field of a DECL with a copy.  */
-extern void copy_lang_decl                     PARAMS ((tree));
-
 /* Function called with no arguments to parse and compile the input.  */
 extern int yyparse                             PARAMS ((void));
 /* Functions for processing symbol declarations.  */