Makefile.in (integrate.o): Update.

* 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
This commit is contained in:
Neil Booth 2002-02-28 07:39:44 +00:00 committed by Neil Booth
parent f472fa2949
commit 63e1b1c4b0
25 changed files with 87 additions and 36 deletions

View 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,

View 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)

View 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

View 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

View 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;

View 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 \

View 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));

View 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

View 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);
}
}

View 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

View 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));

View 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;
}

View 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);

View 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

View 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

View 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

View 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

View 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;
}

View 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));

View 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;

View 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, \

View 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

View 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;

View 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

View File

@ -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. */