aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gcc/ChangeLog28
-rw-r--r--gcc/attribs.c10
-rw-r--r--gcc/c-common.c22
-rw-r--r--gcc/c-common.h6
-rw-r--r--gcc/c-decl.c11
-rw-r--r--gcc/c-lang.c2
-rw-r--r--gcc/c-opts.c3
-rw-r--r--gcc/c-tree.h1
-rw-r--r--gcc/cp/ChangeLog6
-rw-r--r--gcc/cp/cp-lang.c2
-rw-r--r--gcc/cp/cp-tree.h1
-rw-r--r--gcc/cp/decl.c13
-rw-r--r--gcc/langhooks-def.h2
-rw-r--r--gcc/langhooks.h4
-rw-r--r--gcc/objc/objc-lang.c2
-rw-r--r--gcc/system.h2
16 files changed, 37 insertions, 78 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index ee5f70b..60a391c 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,31 @@
+2003-08-04 Roger Sayle <roger@eyesopen.com>
+
+ * c-common.c (flag_noniso_default_format_attributes): Delete.
+ (built_in_attribute): Don't define/undefine DEF_FN_ATTR.
+ (c_attrs_initialized): Delete.
+ (c_common_nodes_and_builtins): Don't test c_attrs_initialized,
+ always call c_init_attributes.
+ (c_init_attributes): Don't define/undefine DEF_FN_ATTR. Don't
+ set c_attrs_initialized when done.
+ (c_common_insert_default_attributes): Delete.
+ * c-common.h (flag_noniso_default_format_attributes): Delete.
+ (c_coomon_insert_default_attributes): Delete prototype.
+ * c-opts.c (set_std_c89, set_std_c99, set_std_cxx98): Dont set
+ flag_noniso_default_format_attributes.
+
+ * c-decl.c (c_insert_default_attributes): Delete.
+ * c-tree.h (c_insert_default_attributes): Delete prototype.
+
+ * attribs.c (decl_attributes): Don't call insert_default_attributes
+ langhook. Update function description comment.
+ * langhooks.h (lang_hooks): Remove insert_default_attributes field.
+ * langhooks-def.h (LANG_HOOKS_INSERT_DEFAULT_ATTRIBUTES): Delete.
+ * c-lang.c (LANG_HOOKS_INSERT_DEFAULT_ATTRIBUTES): Don't define.
+ * system.h: Poison LANG_HOOKS_INSERT_DEFAULT_ATTRIBUTES macro.
+
+ * objc/objc-lang.c (LANG_HOOKS_INSERT_DEFAULT_ATTRIBUTES): Don't
+ define.
+
2003-08-04 Richard Sandiford <rsandif@redhat.com>
* config/mips/mips.c (override_options): Disable -G on targets that
diff --git a/gcc/attribs.c b/gcc/attribs.c
index 6ddacb1..38a4308 100644
--- a/gcc/attribs.c
+++ b/gcc/attribs.c
@@ -134,11 +134,7 @@ init_attributes (void)
information, in the form of a bitwise OR of flags in enum attribute_flags
from tree.h. Depending on these flags, some attributes may be
returned to be applied at a later stage (for example, to apply
- a decl attribute to the declaration rather than to its type). If
- ATTR_FLAG_BUILT_IN is not set and *NODE is a DECL, then also consider
- whether there might be some default attributes to apply to this DECL;
- if so, decl_attributes will be called recursively with those attributes
- and ATTR_FLAG_BUILT_IN set. */
+ a decl attribute to the declaration rather than to its type). */
tree
decl_attributes (tree *node, tree attributes, int flags)
@@ -151,10 +147,6 @@ decl_attributes (tree *node, tree attributes, int flags)
(*targetm.insert_attributes) (*node, &attributes);
- if (DECL_P (*node) && TREE_CODE (*node) == FUNCTION_DECL
- && !(flags & (int) ATTR_FLAG_BUILT_IN))
- (*lang_hooks.insert_default_attributes) (*node);
-
for (a = attributes; a; a = TREE_CHAIN (a))
{
tree name = TREE_PURPOSE (a);
diff --git a/gcc/c-common.c b/gcc/c-common.c
index 5dc87d7..60e980f 100644
--- a/gcc/c-common.c
+++ b/gcc/c-common.c
@@ -372,11 +372,6 @@ int flag_isoc99;
int flag_hosted = 1;
-/* Nonzero means add default format_arg attributes for functions not
- in ISO C. */
-
-int flag_noniso_default_format_attributes = 1;
-
/* Nonzero means warn when casting a function call to a type that does
not match the return type (e.g. (float)sqrt() or (anything*)malloc()
when there is no previous declaration of sqrt or malloc. */
@@ -2957,20 +2952,16 @@ enum built_in_attribute
#define DEF_ATTR_INT(ENUM, VALUE) ENUM,
#define DEF_ATTR_IDENT(ENUM, STRING) ENUM,
#define DEF_ATTR_TREE_LIST(ENUM, PURPOSE, VALUE, CHAIN) ENUM,
-#define DEF_FN_ATTR(NAME, ATTRS, PREDICATE) /* No entry needed in enum. */
#include "builtin-attrs.def"
#undef DEF_ATTR_NULL_TREE
#undef DEF_ATTR_INT
#undef DEF_ATTR_IDENT
#undef DEF_ATTR_TREE_LIST
-#undef DEF_FN_ATTR
ATTR_LAST
};
static GTY(()) tree built_in_attributes[(int) ATTR_LAST];
-static bool c_attrs_initialized = false;
-
static void c_init_attributes (void);
/* Build tree nodes and builtin functions common to both C and C++ language
@@ -3348,8 +3339,7 @@ c_common_nodes_and_builtins (void)
#undef DEF_FUNCTION_TYPE_VAR_3
#undef DEF_POINTER_TYPE
- if (!c_attrs_initialized)
- c_init_attributes ();
+ c_init_attributes ();
#define DEF_BUILTIN(ENUM, NAME, CLASS, TYPE, LIBTYPE, \
BOTH_P, FALLBACK_P, NONANSI_P, ATTRS, IMPLICIT) \
@@ -4176,21 +4166,11 @@ c_init_attributes (void)
= tree_cons (built_in_attributes[(int) PURPOSE], \
built_in_attributes[(int) VALUE], \
built_in_attributes[(int) CHAIN]);
-#define DEF_FN_ATTR(NAME, ATTRS, PREDICATE) /* No initialization needed. */
#include "builtin-attrs.def"
#undef DEF_ATTR_NULL_TREE
#undef DEF_ATTR_INT
#undef DEF_ATTR_IDENT
#undef DEF_ATTR_TREE_LIST
-#undef DEF_FN_ATTR
- c_attrs_initialized = true;
-}
-
-/* Depending on the name of DECL, apply default attributes to it. */
-
-void
-c_common_insert_default_attributes (tree decl ATTRIBUTE_UNUSED)
-{
}
/* Output a -Wshadow warning MSGCODE about NAME, and give the location
diff --git a/gcc/c-common.h b/gcc/c-common.h
index da673f6..9be6dfe 100644
--- a/gcc/c-common.h
+++ b/gcc/c-common.h
@@ -549,11 +549,6 @@ extern int flag_isoc99;
extern int flag_hosted;
-/* Nonzero means add default format_arg attributes for functions not
- in ISO C. */
-
-extern int flag_noniso_default_format_attributes;
-
/* Nonzero means warn when casting a function call to a type that does
not match the return type (e.g. (float)sqrt() or (anything*)malloc()
when there is no previous declaration of sqrt or malloc. */
@@ -893,7 +888,6 @@ extern void check_function_format (int *, tree, tree);
extern void set_Wformat (int);
extern tree handle_format_attribute (tree *, tree, tree, int, bool *);
extern tree handle_format_arg_attribute (tree *, tree, tree, int, bool *);
-extern void c_common_insert_default_attributes (tree);
extern int c_common_handle_option (size_t code, const char *arg, int value);
extern bool c_common_missing_argument (const char *opt, size_t code);
extern tree c_common_type_for_mode (enum machine_mode, int);
diff --git a/gcc/c-decl.c b/gcc/c-decl.c
index cfe1a8e..550d6c8 100644
--- a/gcc/c-decl.c
+++ b/gcc/c-decl.c
@@ -2370,17 +2370,6 @@ builtin_function (const char *name, tree type, int function_code,
return decl;
}
-
-/* Apply default attributes to a function, if a system function with default
- attributes. */
-
-void
-c_insert_default_attributes (tree decl)
-{
- if (!TREE_PUBLIC (decl))
- return;
- c_common_insert_default_attributes (decl);
-}
/* Called when a declaration is seen that contains no names to declare.
If its type is a reference to a structure, union or enum inherited
diff --git a/gcc/c-lang.c b/gcc/c-lang.c
index fb729f3..d998e19 100644
--- a/gcc/c-lang.c
+++ b/gcc/c-lang.c
@@ -61,8 +61,6 @@ enum c_language_kind c_language = clk_c;
#define LANG_HOOKS_PARSE_FILE c_common_parse_file
#undef LANG_HOOKS_TRUTHVALUE_CONVERSION
#define LANG_HOOKS_TRUTHVALUE_CONVERSION c_common_truthvalue_conversion
-#undef LANG_HOOKS_INSERT_DEFAULT_ATTRIBUTES
-#define LANG_HOOKS_INSERT_DEFAULT_ATTRIBUTES c_insert_default_attributes
#undef LANG_HOOKS_FINISH_INCOMPLETE_DECL
#define LANG_HOOKS_FINISH_INCOMPLETE_DECL c_finish_incomplete_decl
#undef LANG_HOOKS_UNSAFE_FOR_REEVAL
diff --git a/gcc/c-opts.c b/gcc/c-opts.c
index e1922cb..012f24b 100644
--- a/gcc/c-opts.c
+++ b/gcc/c-opts.c
@@ -1459,7 +1459,6 @@ set_std_c89 (int c94, int iso)
flag_no_asm = iso;
flag_no_gnu_keywords = iso;
flag_no_nonansi_builtin = iso;
- flag_noniso_default_format_attributes = !iso;
flag_isoc94 = c94;
flag_isoc99 = 0;
flag_writable_strings = 0;
@@ -1472,7 +1471,6 @@ set_std_c99 (int iso)
cpp_set_lang (parse_in, iso ? CLK_STDC99: CLK_GNUC99);
flag_no_asm = iso;
flag_no_nonansi_builtin = iso;
- flag_noniso_default_format_attributes = !iso;
flag_iso = iso;
flag_isoc99 = 1;
flag_isoc94 = 1;
@@ -1486,7 +1484,6 @@ set_std_cxx98 (int iso)
cpp_set_lang (parse_in, iso ? CLK_CXX98: CLK_GNUCXX);
flag_no_gnu_keywords = iso;
flag_no_nonansi_builtin = iso;
- flag_noniso_default_format_attributes = !iso;
flag_iso = iso;
}
diff --git a/gcc/c-tree.h b/gcc/c-tree.h
index f2f27de..afcd042 100644
--- a/gcc/c-tree.h
+++ b/gcc/c-tree.h
@@ -186,7 +186,6 @@ extern void insert_block (tree);
extern void set_block (tree);
extern tree pushdecl (tree);
-extern void c_insert_default_attributes (tree);
extern void c_init_decl_processing (void);
extern void c_dup_lang_specific_decl (tree);
extern void c_print_identifier (FILE *, tree, int);
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index a8c8a97..737a97c 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,3 +1,9 @@
+2003-08-04 Roger Sayle <roger@eyesopen.com>
+
+ * decl.c (cxx_insert_default_attributes): Delete.
+ * cp-tree.h (cxx_insert_default_attributes): Don't prototype.
+ * cp-lang.c (LANG_HOOKS_INSERT_DEFAULT_ATTRIBUTES): Don't define.
+
2003-08-03 Nathan Sidwell <nathan@codesourcery.com>
PR c++/11704
diff --git a/gcc/cp/cp-lang.c b/gcc/cp/cp-lang.c
index 6de9210..ab0d305 100644
--- a/gcc/cp/cp-lang.c
+++ b/gcc/cp/cp-lang.c
@@ -77,8 +77,6 @@ static bool cp_var_mod_type_p (tree);
#define LANG_HOOKS_MAYBE_BUILD_CLEANUP cxx_maybe_build_cleanup
#undef LANG_HOOKS_TRUTHVALUE_CONVERSION
#define LANG_HOOKS_TRUTHVALUE_CONVERSION c_common_truthvalue_conversion
-#undef LANG_HOOKS_INSERT_DEFAULT_ATTRIBUTES
-#define LANG_HOOKS_INSERT_DEFAULT_ATTRIBUTES cxx_insert_default_attributes
#undef LANG_HOOKS_UNSAFE_FOR_REEVAL
#define LANG_HOOKS_UNSAFE_FOR_REEVAL c_common_unsafe_for_reeval
#undef LANG_HOOKS_SET_DECL_ASSEMBLER_NAME
diff --git a/gcc/cp/cp-tree.h b/gcc/cp/cp-tree.h
index 1e84a53..ffae1bf 100644
--- a/gcc/cp/cp-tree.h
+++ b/gcc/cp/cp-tree.h
@@ -3638,7 +3638,6 @@ extern tree pushdecl (tree);
extern void cxx_init_decl_processing (void);
enum cp_tree_node_structure_enum cp_tree_node_structure
(union lang_tree_node *);
-extern void cxx_insert_default_attributes (tree);
extern bool cxx_mark_addressable (tree);
extern void cxx_push_function_context (struct function *);
extern void cxx_pop_function_context (struct function *);
diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c
index ab6913c..6bd5c86 100644
--- a/gcc/cp/decl.c
+++ b/gcc/cp/decl.c
@@ -6642,19 +6642,6 @@ push_throw_library_fn (tree name, tree type)
TREE_NOTHROW (fn) = 0;
return fn;
}
-
-/* Apply default attributes to a function, if a system function with default
- attributes. */
-
-void
-cxx_insert_default_attributes (tree decl)
-{
- if (!DECL_EXTERN_C_FUNCTION_P (decl))
- return;
- if (!TREE_PUBLIC (decl))
- return;
- c_common_insert_default_attributes (decl);
-}
/* When we call finish_struct for an anonymous union, we create
default copy constructors and such. But, an anonymous union
diff --git a/gcc/langhooks-def.h b/gcc/langhooks-def.h
index 47e8b72..478553b 100644
--- a/gcc/langhooks-def.h
+++ b/gcc/langhooks-def.h
@@ -99,7 +99,6 @@ extern void lhd_initialize_diagnostics (struct diagnostic_context *);
#define LANG_HOOKS_FINISH_INCOMPLETE_DECL lhd_do_nothing_t
#define LANG_HOOKS_UNSAFE_FOR_REEVAL lhd_unsafe_for_reeval
#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_UNSAVE_EXPR_NOW lhd_unsave_expr_now
#define LANG_HOOKS_MAYBE_BUILD_CLEANUP lhd_return_null_tree
@@ -259,7 +258,6 @@ extern int lhd_tree_dump_type_quals (tree);
LANG_HOOKS_EXPAND_CONSTANT, \
LANG_HOOKS_EXPAND_EXPR, \
LANG_HOOKS_TRUTHVALUE_CONVERSION, \
- LANG_HOOKS_INSERT_DEFAULT_ATTRIBUTES, \
LANG_HOOKS_SAFE_FROM_P, \
LANG_HOOKS_FINISH_INCOMPLETE_DECL, \
LANG_HOOKS_UNSAFE_FOR_REEVAL, \
diff --git a/gcc/langhooks.h b/gcc/langhooks.h
index fbdaadc..4ac0250 100644
--- a/gcc/langhooks.h
+++ b/gcc/langhooks.h
@@ -272,10 +272,6 @@ struct lang_hooks
error_mark_node). */
tree (*truthvalue_conversion) (tree);
- /* Possibly apply default attributes to a function (represented by
- a FUNCTION_DECL). */
- void (*insert_default_attributes) (tree);
-
/* 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
codes that safe_from_p needs to know about. Since same_from_p will
diff --git a/gcc/objc/objc-lang.c b/gcc/objc/objc-lang.c
index 1700fb0..eda8c5d 100644
--- a/gcc/objc/objc-lang.c
+++ b/gcc/objc/objc-lang.c
@@ -61,8 +61,6 @@ enum c_language_kind c_language = clk_objc;
#define LANG_HOOKS_MARK_ADDRESSABLE c_mark_addressable
#undef LANG_HOOKS_TRUTHVALUE_CONVERSION
#define LANG_HOOKS_TRUTHVALUE_CONVERSION c_common_truthvalue_conversion
-#undef LANG_HOOKS_INSERT_DEFAULT_ATTRIBUTES
-#define LANG_HOOKS_INSERT_DEFAULT_ATTRIBUTES c_insert_default_attributes
#undef LANG_HOOKS_FINISH_INCOMPLETE_DECL
#define LANG_HOOKS_FINISH_INCOMPLETE_DECL c_finish_incomplete_decl
#undef LANG_HOOKS_UNSAFE_FOR_REEVAL
diff --git a/gcc/system.h b/gcc/system.h
index a0117c5..aae0dda 100644
--- a/gcc/system.h
+++ b/gcc/system.h
@@ -614,7 +614,7 @@ typedef char _Bool;
/* Hooks that are no longer used. */
#pragma GCC poison LANG_HOOKS_FUNCTION_MARK LANG_HOOKS_FUNCTION_FREE \
- LANG_HOOKS_MARK_TREE
+ LANG_HOOKS_MARK_TREE LANG_HOOKS_INSERT_DEFAULT_ATTRIBUTES
/* Libiberty macros that are no longer used in GCC. */
#undef ANSI_PROTOTYPES