Commit 7ffb4fd2 by Neil Booth Committed by Neil Booth

Makefile.in (attribs.o): Update.

	* Makefile.in (attribs.o): Update.
	* attribs.c: Include langhooks.h.
	(decl_attributes): Use langhook.
	* c-decl.c (insert_default_attributes): Rename.
	* c-tree.h (c_insert_default_attributes): New.
	* langhooks-def.h (LANG_HOOKS_INSERT_DEFAULT_ATTRIBUTES):New.
	(LANG_HOOKS_INITIALIZER): Update.
	* langhooks.h (struct lang_hooks): New hook.
	* tree.h (insert_default_attributes): Remove.
ada:
	* misc.c (insert_default_attributes): Remove.
cp:
	* cp-lang.c (LANG_HOOKS_INSERT_DEFAULT_ATTRIBUTES): Redefine.
	* cp-tree.h (cxx_insert_default_attributes): New.
	* decl.c (insert_default_attributes): Rename.
objc:
	* objc-lang.c (LANG_HOOKS_INSERT_DEFAULT_ATTRIBUTES): Redefine.

From-SVN: r51488
parent 39bea374
2002-03-27 Neil Booth <neil@daikokuya.demon.co.uk>
* Makefile.in (attribs.o): Update.
* attribs.c: Include langhooks.h.
(decl_attributes): Use langhook.
* c-decl.c (insert_default_attributes): Rename.
* c-tree.h (c_insert_default_attributes): New.
* langhooks-def.h (LANG_HOOKS_INSERT_DEFAULT_ATTRIBUTES):New.
(LANG_HOOKS_INITIALIZER): Update.
* langhooks.h (struct lang_hooks): New hook.
* tree.h (insert_default_attributes): Remove.
objc:
* objc-lang.c (LANG_HOOKS_INSERT_DEFAULT_ATTRIBUTES): Redefine.
2002-03-27 Andreas Schwab <schwab@suse.de> 2002-03-27 Andreas Schwab <schwab@suse.de>
* config/i386/i386.c (classify_argument): Also check for * config/i386/i386.c (classify_argument): Also check for
......
...@@ -1214,7 +1214,7 @@ c-common.o : c-common.c $(CONFIG_H) $(SYSTEM_H) $(TREE_H) $(OBSTACK_H) \ ...@@ -1214,7 +1214,7 @@ c-common.o : c-common.c $(CONFIG_H) $(SYSTEM_H) $(TREE_H) $(OBSTACK_H) \
attribs.o : attribs.c $(CONFIG_H) $(SYSTEM_H) $(TREE_H) $(OBSTACK_H) flags.h \ attribs.o : attribs.c $(CONFIG_H) $(SYSTEM_H) $(TREE_H) $(OBSTACK_H) flags.h \
toplev.h output.h c-pragma.h $(RTL_H) $(GGC_H) $(EXPR_H) $(TM_P_H) \ toplev.h output.h c-pragma.h $(RTL_H) $(GGC_H) $(EXPR_H) $(TM_P_H) \
builtin-types.def $(TARGET_H) builtin-types.def $(TARGET_H) langhooks.h
c-format.o : c-format.c $(CONFIG_H) $(SYSTEM_H) $(TREE_H) \ c-format.o : c-format.c $(CONFIG_H) $(SYSTEM_H) $(TREE_H) \
$(C_COMMON_H) flags.h toplev.h intl.h diagnostic.h $(C_COMMON_H) flags.h toplev.h intl.h diagnostic.h
......
2002-03-27 Neil Booth <neil@daikokuya.demon.co.uk> 2002-03-27 Neil Booth <neil@daikokuya.demon.co.uk>
* misc.c (insert_default_attributes): Remove.
2002-03-27 Neil Booth <neil@daikokuya.demon.co.uk>
* misc.c (LANG_HOOKS_EXPAND_EXPR): Redefine. * misc.c (LANG_HOOKS_EXPAND_EXPR): Redefine.
(gnat_init): Don't set hook. (gnat_init): Don't set hook.
(gnat_expand_expr): Fix prototype. (gnat_expand_expr): Fix prototype.
......
...@@ -801,14 +801,6 @@ gnat_get_alias_set (type) ...@@ -801,14 +801,6 @@ gnat_get_alias_set (type)
return -1; return -1;
} }
/* Set default attributes for functions. We do nothing. */
void
insert_default_attributes (decl)
tree decl ATTRIBUTE_UNUSED;
{
}
/* GNU_TYPE is a type. Determine if it should be passed by reference by /* GNU_TYPE is a type. Determine if it should be passed by reference by
default. */ default. */
......
...@@ -32,6 +32,7 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA ...@@ -32,6 +32,7 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
#include "obstack.h" #include "obstack.h"
#include "cpplib.h" #include "cpplib.h"
#include "target.h" #include "target.h"
#include "langhooks.h"
static void init_attributes PARAMS ((void)); static void init_attributes PARAMS ((void));
...@@ -274,7 +275,7 @@ decl_attributes (node, attributes, flags) ...@@ -274,7 +275,7 @@ decl_attributes (node, attributes, flags)
if (DECL_P (*node) && TREE_CODE (*node) == FUNCTION_DECL if (DECL_P (*node) && TREE_CODE (*node) == FUNCTION_DECL
&& !(flags & (int) ATTR_FLAG_BUILT_IN)) && !(flags & (int) ATTR_FLAG_BUILT_IN))
insert_default_attributes (*node); (*lang_hooks.insert_default_attributes) (*node);
for (a = attributes; a; a = TREE_CHAIN (a)) for (a = attributes; a; a = TREE_CHAIN (a))
{ {
......
...@@ -3087,7 +3087,7 @@ builtin_function (name, type, function_code, class, library_name) ...@@ -3087,7 +3087,7 @@ builtin_function (name, type, function_code, class, library_name)
attributes. */ attributes. */
void void
insert_default_attributes (decl) c_insert_default_attributes (decl)
tree decl; tree decl;
{ {
if (!TREE_PUBLIC (decl)) if (!TREE_PUBLIC (decl))
......
...@@ -56,6 +56,8 @@ static void c_post_options PARAMS ((void)); ...@@ -56,6 +56,8 @@ static void c_post_options PARAMS ((void));
#define LANG_HOOKS_EXPAND_EXPR c_expand_expr #define LANG_HOOKS_EXPAND_EXPR c_expand_expr
#undef LANG_HOOKS_PARSE_FILE #undef LANG_HOOKS_PARSE_FILE
#define LANG_HOOKS_PARSE_FILE c_common_parse_file #define LANG_HOOKS_PARSE_FILE c_common_parse_file
#undef LANG_HOOKS_INSERT_DEFAULT_ATTRIBUTES
#define LANG_HOOKS_INSERT_DEFAULT_ATTRIBUTES c_insert_default_attributes
#undef LANG_HOOKS_STATICP #undef LANG_HOOKS_STATICP
#define LANG_HOOKS_STATICP c_staticp #define LANG_HOOKS_STATICP c_staticp
#undef LANG_HOOKS_PRINT_IDENTIFIER #undef LANG_HOOKS_PRINT_IDENTIFIER
......
...@@ -175,6 +175,7 @@ extern void insert_block PARAMS ((tree)); ...@@ -175,6 +175,7 @@ extern void insert_block PARAMS ((tree));
extern void set_block PARAMS ((tree)); extern void set_block PARAMS ((tree));
extern tree pushdecl PARAMS ((tree)); extern tree pushdecl PARAMS ((tree));
extern void c_insert_default_attributes PARAMS ((tree));
extern void c_init_decl_processing PARAMS ((void)); extern void c_init_decl_processing PARAMS ((void));
extern void c_dup_lang_specific_decl PARAMS ((tree)); extern void c_dup_lang_specific_decl PARAMS ((tree));
extern void c_print_identifier PARAMS ((FILE *, tree, int)); extern void c_print_identifier PARAMS ((FILE *, tree, int));
......
2002-03-27 Neil Booth <neil@daikokuya.demon.co.uk>
* cp-lang.c (LANG_HOOKS_INSERT_DEFAULT_ATTRIBUTES): Redefine.
* cp-tree.h (cxx_insert_default_attributes): New.
* decl.c (insert_default_attributes): Rename.
2002-03-27 Mark Mitchell <mark@codesourcery.com> 2002-03-27 Mark Mitchell <mark@codesourcery.com>
PR c++/4884 PR c++/4884
......
...@@ -61,6 +61,8 @@ static bool ok_to_generate_alias_set_for_type PARAMS ((tree)); ...@@ -61,6 +61,8 @@ static bool ok_to_generate_alias_set_for_type PARAMS ((tree));
#define LANG_HOOKS_UNSAVE_EXPR_NOW cxx_unsave_expr_now #define LANG_HOOKS_UNSAVE_EXPR_NOW cxx_unsave_expr_now
#undef LANG_HOOKS_MAYBE_BUILD_CLEANUP #undef LANG_HOOKS_MAYBE_BUILD_CLEANUP
#define LANG_HOOKS_MAYBE_BUILD_CLEANUP cxx_maybe_build_cleanup #define LANG_HOOKS_MAYBE_BUILD_CLEANUP cxx_maybe_build_cleanup
#undef LANG_HOOKS_INSERT_DEFAULT_ATTRIBUTES
#define LANG_HOOKS_INSERT_DEFAULT_ATTRIBUTES cxx_insert_default_attributes
#undef LANG_HOOKS_MARK_TREE #undef LANG_HOOKS_MARK_TREE
#define LANG_HOOKS_MARK_TREE cxx_mark_tree #define LANG_HOOKS_MARK_TREE cxx_mark_tree
#undef LANG_HOOKS_PRINT_STATISTICS #undef LANG_HOOKS_PRINT_STATISTICS
......
...@@ -3667,6 +3667,7 @@ extern void set_block PARAMS ((tree)); ...@@ -3667,6 +3667,7 @@ extern void set_block PARAMS ((tree));
extern tree pushdecl PARAMS ((tree)); extern tree pushdecl PARAMS ((tree));
extern void cxx_init_decl_processing PARAMS ((void)); extern void cxx_init_decl_processing PARAMS ((void));
extern void cxx_mark_tree PARAMS ((tree)); extern void cxx_mark_tree PARAMS ((tree));
extern void cxx_insert_default_attributes PARAMS ((tree));
extern int toplevel_bindings_p PARAMS ((void)); extern int toplevel_bindings_p PARAMS ((void));
extern int namespace_bindings_p PARAMS ((void)); extern int namespace_bindings_p PARAMS ((void));
extern void keep_next_level PARAMS ((int)); extern void keep_next_level PARAMS ((int));
......
...@@ -6886,7 +6886,7 @@ push_throw_library_fn (name, type) ...@@ -6886,7 +6886,7 @@ push_throw_library_fn (name, type)
attributes. */ attributes. */
void void
insert_default_attributes (decl) cxx_insert_default_attributes (decl)
tree decl; tree decl;
{ {
if (!DECL_EXTERN_C_FUNCTION_P (decl)) if (!DECL_EXTERN_C_FUNCTION_P (decl))
......
...@@ -82,6 +82,7 @@ tree lhd_tree_inlining_convert_parm_for_inlining PARAMS ((tree, tree, tree)); ...@@ -82,6 +82,7 @@ tree lhd_tree_inlining_convert_parm_for_inlining PARAMS ((tree, tree, tree));
#define LANG_HOOKS_EXPAND_EXPR lhd_expand_expr #define LANG_HOOKS_EXPAND_EXPR lhd_expand_expr
#define LANG_HOOKS_SAFE_FROM_P lhd_safe_from_p #define LANG_HOOKS_SAFE_FROM_P lhd_safe_from_p
#define LANG_HOOKS_STATICP lhd_staticp #define LANG_HOOKS_STATICP lhd_staticp
#define LANG_HOOKS_INSERT_DEFAULT_ATTRIBUTES lhd_do_nothing_t
#define LANG_HOOKS_DUP_LANG_SPECIFIC_DECL lhd_do_nothing_t #define LANG_HOOKS_DUP_LANG_SPECIFIC_DECL lhd_do_nothing_t
#define LANG_HOOKS_UNSAVE_EXPR_NOW lhd_unsave_expr_now #define LANG_HOOKS_UNSAVE_EXPR_NOW lhd_unsave_expr_now
#define LANG_HOOKS_MAYBE_BUILD_CLEANUP lhd_return_null_tree #define LANG_HOOKS_MAYBE_BUILD_CLEANUP lhd_return_null_tree
...@@ -177,6 +178,7 @@ int lhd_tree_dump_type_quals PARAMS ((tree)); ...@@ -177,6 +178,7 @@ int lhd_tree_dump_type_quals PARAMS ((tree));
LANG_HOOKS_GET_ALIAS_SET, \ LANG_HOOKS_GET_ALIAS_SET, \
LANG_HOOKS_EXPAND_CONSTANT, \ LANG_HOOKS_EXPAND_CONSTANT, \
LANG_HOOKS_EXPAND_EXPR, \ LANG_HOOKS_EXPAND_EXPR, \
LANG_HOOKS_INSERT_DEFAULT_ATTRIBUTES, \
LANG_HOOKS_SAFE_FROM_P, \ LANG_HOOKS_SAFE_FROM_P, \
LANG_HOOKS_STATICP, \ LANG_HOOKS_STATICP, \
LANG_HOOKS_DUP_LANG_SPECIFIC_DECL, \ LANG_HOOKS_DUP_LANG_SPECIFIC_DECL, \
......
...@@ -165,6 +165,10 @@ struct lang_hooks ...@@ -165,6 +165,10 @@ struct lang_hooks
Fourth argument is actually an enum expand_modifier. */ Fourth argument is actually an enum expand_modifier. */
rtx (*expand_expr) PARAMS ((tree, rtx, enum machine_mode, int)); rtx (*expand_expr) PARAMS ((tree, rtx, enum machine_mode, int));
/* Possibly apply default attributes to a function (represented by
a FUNCTION_DECL). */
void (*insert_default_attributes) PARAMS ((tree));
/* Hook called by safe_from_p for language-specific tree codes. It is /* Hook called by safe_from_p for language-specific tree codes. It is
up to the language front-end to install a hook if it has any such up to the language front-end to install a hook if it has any such
codes that safe_from_p needs to know about. Since same_from_p will codes that safe_from_p needs to know about. Since same_from_p will
......
...@@ -50,6 +50,8 @@ static void objc_post_options PARAMS ((void)); ...@@ -50,6 +50,8 @@ static void objc_post_options PARAMS ((void));
#define LANG_HOOKS_MARK_TREE c_mark_tree #define LANG_HOOKS_MARK_TREE c_mark_tree
#undef LANG_HOOKS_EXPAND_EXPR #undef LANG_HOOKS_EXPAND_EXPR
#define LANG_HOOKS_EXPAND_EXPR c_expand_expr #define LANG_HOOKS_EXPAND_EXPR c_expand_expr
#undef LANG_HOOKS_INSERT_DEFAULT_ATTRIBUTES
#define LANG_HOOKS_INSERT_DEFAULT_ATTRIBUTES c_insert_default_attributes
#undef LANG_HOOKS_STATICP #undef LANG_HOOKS_STATICP
#define LANG_HOOKS_STATICP c_staticp #define LANG_HOOKS_STATICP c_staticp
#undef LANG_HOOKS_DUP_LANG_SPECIFIC_DECL #undef LANG_HOOKS_DUP_LANG_SPECIFIC_DECL
......
...@@ -2976,10 +2976,6 @@ extern tree decl_attributes PARAMS ((tree *, tree, int)); ...@@ -2976,10 +2976,6 @@ extern tree decl_attributes PARAMS ((tree *, tree, int));
/* The following function must be provided by front ends /* The following function must be provided by front ends
using attribs.c. */ using attribs.c. */
/* Possibly apply default attributes to a function (represented by
a FUNCTION_DECL). */
extern void insert_default_attributes PARAMS ((tree));
/* Table of machine-independent attributes for checking formats, if used. */ /* Table of machine-independent attributes for checking formats, if used. */
extern const struct attribute_spec *format_attribute_table; extern const struct attribute_spec *format_attribute_table;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment