diff options
-rw-r--r-- | gcc/ChangeLog | 16 | ||||
-rw-r--r-- | gcc/Makefile.in | 2 | ||||
-rw-r--r-- | gcc/ada/ChangeLog | 4 | ||||
-rw-r--r-- | gcc/ada/misc.c | 11 | ||||
-rw-r--r-- | gcc/c-decl.c | 4 | ||||
-rw-r--r-- | gcc/c-lang.c | 2 | ||||
-rw-r--r-- | gcc/c-tree.h | 1 | ||||
-rw-r--r-- | gcc/cp/ChangeLog | 9 | ||||
-rw-r--r-- | gcc/cp/class.c | 2 | ||||
-rw-r--r-- | gcc/cp/cp-lang.c | 2 | ||||
-rw-r--r-- | gcc/cp/cp-tree.h | 1 | ||||
-rw-r--r-- | gcc/cp/lex.c | 4 | ||||
-rw-r--r-- | gcc/cp/method.c | 2 | ||||
-rw-r--r-- | gcc/f/ChangeLog | 4 | ||||
-rw-r--r-- | gcc/f/com.c | 9 | ||||
-rw-r--r-- | gcc/integrate.c | 4 | ||||
-rw-r--r-- | gcc/java/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/java/decl.c | 17 | ||||
-rw-r--r-- | gcc/java/java-tree.h | 1 | ||||
-rw-r--r-- | gcc/java/lang.c | 2 | ||||
-rw-r--r-- | gcc/langhooks-def.h | 3 | ||||
-rw-r--r-- | gcc/langhooks.c | 8 | ||||
-rw-r--r-- | gcc/langhooks.h | 4 | ||||
-rw-r--r-- | gcc/objc/objc-lang.c | 2 | ||||
-rw-r--r-- | gcc/tree.h | 3 |
25 files changed, 87 insertions, 36 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 1f9dd893f03..3074e4b47af 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -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, diff --git a/gcc/Makefile.in b/gcc/Makefile.in index a7f05d4cd9b..604dd7dd8ff 100644 --- a/gcc/Makefile.in +++ b/gcc/Makefile.in @@ -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) diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog index 1443a9052cd..875b3d5bc18 100644 --- a/gcc/ada/ChangeLog +++ b/gcc/ada/ChangeLog @@ -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 diff --git a/gcc/ada/misc.c b/gcc/ada/misc.c index c4da9226dd8..78b04c8da2d 100644 --- a/gcc/ada/misc.c +++ b/gcc/ada/misc.c @@ -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 diff --git a/gcc/c-decl.c b/gcc/c-decl.c index 177bcea5744..21ff5eeacd1 100644 --- a/gcc/c-decl.c +++ b/gcc/c-decl.c @@ -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; diff --git a/gcc/c-lang.c b/gcc/c-lang.c index 497d32af122..174f9dc8106 100644 --- a/gcc/c-lang.c +++ b/gcc/c-lang.c @@ -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 \ diff --git a/gcc/c-tree.h b/gcc/c-tree.h index 064ee0889a9..d6f622e0ff5 100644 --- a/gcc/c-tree.h +++ b/gcc/c-tree.h @@ -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)); diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index d2c80e0302f..410479c0d22 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -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 diff --git a/gcc/cp/class.c b/gcc/cp/class.c index 40702867405..9e3c110a2e5 100644 --- a/gcc/cp/class.c +++ b/gcc/cp/class.c @@ -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); } } diff --git a/gcc/cp/cp-lang.c b/gcc/cp/cp-lang.c index c40330bc319..800a8701de2 100644 --- a/gcc/cp/cp-lang.c +++ b/gcc/cp/cp-lang.c @@ -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 diff --git a/gcc/cp/cp-tree.h b/gcc/cp/cp-tree.h index 65811323751..73aed25d5bf 100644 --- a/gcc/cp/cp-tree.h +++ b/gcc/cp/cp-tree.h @@ -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)); diff --git a/gcc/cp/lex.c b/gcc/cp/lex.c index 885002a9793..d338632bc32 100644 --- a/gcc/cp/lex.c +++ b/gcc/cp/lex.c @@ -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; } diff --git a/gcc/cp/method.c b/gcc/cp/method.c index 52a6a8cf59d..35e40ebbac6 100644 --- a/gcc/cp/method.c +++ b/gcc/cp/method.c @@ -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); diff --git a/gcc/f/ChangeLog b/gcc/f/ChangeLog index 3809a19b637..94cf6911a57 100644 --- a/gcc/f/ChangeLog +++ b/gcc/f/ChangeLog @@ -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 diff --git a/gcc/f/com.c b/gcc/f/com.c index 3c4a1d5d370..d1e769a21bc 100644 --- a/gcc/f/com.c +++ b/gcc/f/com.c @@ -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 diff --git a/gcc/integrate.c b/gcc/integrate.c index ad6b2a1f52a..59c1550bd37 100644 --- a/gcc/integrate.c +++ b/gcc/integrate.c @@ -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 diff --git a/gcc/java/ChangeLog b/gcc/java/ChangeLog index 4076a77b78d..a4ef231a159 100644 --- a/gcc/java/ChangeLog +++ b/gcc/java/ChangeLog @@ -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 diff --git a/gcc/java/decl.c b/gcc/java/decl.c index f9bbc9f672b..eaa7c48144f 100644 --- a/gcc/java/decl.c +++ b/gcc/java/decl.c @@ -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; } diff --git a/gcc/java/java-tree.h b/gcc/java/java-tree.h index 8f64ef2e9a4..7097b56d720 100644 --- a/gcc/java/java-tree.h +++ b/gcc/java/java-tree.h @@ -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)); diff --git a/gcc/java/lang.c b/gcc/java/lang.c index 15203902166..6be8f2bafa5 100644 --- a/gcc/java/lang.c +++ b/gcc/java/lang.c @@ -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; diff --git a/gcc/langhooks-def.h b/gcc/langhooks-def.h index ca55a82797d..89002aa0796 100644 --- a/gcc/langhooks-def.h +++ b/gcc/langhooks-def.h @@ -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, \ diff --git a/gcc/langhooks.c b/gcc/langhooks.c index de5519caf20..a976d748029 100644 --- a/gcc/langhooks.c +++ b/gcc/langhooks.c @@ -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 diff --git a/gcc/langhooks.h b/gcc/langhooks.h index 81ae71b4dc0..8203fd19214 100644 --- a/gcc/langhooks.h +++ b/gcc/langhooks.h @@ -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; diff --git a/gcc/objc/objc-lang.c b/gcc/objc/objc-lang.c index 7e2cae7bf00..8f155c2b23e 100644 --- a/gcc/objc/objc-lang.c +++ b/gcc/objc/objc-lang.c @@ -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 diff --git a/gcc/tree.h b/gcc/tree.h index 8e17b534225..06d9815ba15 100644 --- a/gcc/tree.h +++ b/gcc/tree.h @@ -2859,9 +2859,6 @@ extern tree fold_builtin PARAMS ((tree)); /* 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. */ |