* 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.
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.
From-SVN: r50122
+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,
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)
+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
* *
* C Implementation File *
* *
- * $Revision: 1.17 $
+ * $Revision: 1.18 $
* *
* Copyright (C) 1992-2001 Free Software Foundation, Inc. *
* *
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
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;
#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 \
/* 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));
+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
for (parms = DECL_ARGUMENTS (clone); parms; parms = TREE_CHAIN (parms))
{
DECL_CONTEXT (parms) = clone;
- copy_lang_decl (parms);
+ cxx_dup_lang_specific_decl (parms);
}
}
#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
/* 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));
}
void
-copy_lang_decl (node)
+cxx_dup_lang_specific_decl (node)
tree node;
{
int size;
tree copy;
copy = copy_node (decl);
- copy_lang_decl (copy);
+ cxx_dup_lang_specific_decl (copy);
return copy;
}
{
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);
+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
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
#include "params.h"
#include "ggc.h"
#include "target.h"
+#include "langhooks.h"
#include "obstack.h"
#define obstack_chunk_alloc xmalloc
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
+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
/* 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;
}
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));
#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;
/* 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));
#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
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, \
{
}
+/* Do nothing. */
+
+void
+lhd_do_nothing_t (t)
+ tree t ATTRIBUTE_UNUSED;
+{
+}
+
/* Do nothing (return the tree node passed). */
tree
/* 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;
#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
\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. */