attribs.c (c_common_attribute_table): Move table and handlers to c-common.c.
* attribs.c (c_common_attribute_table): Move table and handlers to c-common.c. (format_attribute_table, lang_attribute_table, lang_attribute_common): Remove. (init_attributes): Replace NULL pointers with pointers to the empty table. (handle_packed_attribute, handle_nocommon_attribute, handle_common_attribute, handle_noreturn_attribute, handle_noinline_attribute, handle_always_inline_attribute, handle_used_attribute, handle_unused_attribute, handle_const_attribute, handle_transparent_union_attribute, handle_constructor_attribute, handle_destructor_attribute, handle_mode_attribute, handle_section_attribute, handle_aligned_attribute, handle_weak_attribute, handle_alias_attribute, handle_visibility_attribute, handle_no_instrument_function_attribute, handle_malloc_attribute, handle_no_limit_stack_attribute, handle_pure_attribute, handle_deprecated_attribute, handle_vector_size_attribute, vector_size_helper): Move to c-common.c. * c-common.c (c_common_attribute_table, handle_packed_attribute, handle_nocommon_attribute, handle_common_attribute, handle_noreturn_attribute, handle_noinline_attribute, handle_always_inline_attribute, handle_used_attribute, handle_unused_attribute, handle_const_attribute, handle_transparent_union_attribute, handle_constructor_attribute, handle_destructor_attribute, handle_mode_attribute, handle_section_attribute, handle_aligned_attribute, handle_weak_attribute, handle_alias_attribute, handle_visibility_attribute, handle_no_instrument_function_attribute, handle_malloc_attribute, handle_no_limit_stack_attribute, handle_pure_attribute, handle_deprecated_attribute, handle_vector_size_attribute, vector_size_helper): Move from attribs.c. * c-common.h (c_common_attribute_table, c_common_format_attribute_table): New. * c-lang.c (LANG_HOOKS_COMMON_ATTRIBUTE_TABLE, LANG_HOOKS_FORMAT_ATTRIBUTE_TABLE): Redefine. * langhooks-def.h (LANG_HOOKS_FORMAT_ATTRIBUTE_TABLE, LANG_HOOKS_COMMON_ATTRIBUTE_TABLE, LANG_HOOKS_ATTRIBUTE_TABLE): New. (LANG_HOOKS_INITIALIZER): Update. * langhooks.h (struct lang_hooks): 3 new attribute hooks. * target-def.h (TARGET_ATTRIBUTE_TABLE): Default to NULL. * target.h: Update comment. * tree.c (default_target_attribute_table): Remove. * tree.h (default_target_attribute_table, format_attribute_table, lang_attribute_table, lang_attribute_common): Remove. ada: * misc.c (gnat_init): Don't set lang_attribute_common. cp: * cp-lang.c (LANG_HOOKS_COMMON_ATTRIBUTE_TABLE, LANG_HOOKS_FORMAT_ATTRIBUTE_TABLE, LANG_HOOKS_ATTRIBUTE_TABLE): Redefine. * cp-tree.h (cp_attribute_table): Rename. * decl.c (lang_attribute_table): Remove declaration. (cxx_init_decl_processing): Don't set it. * tree.c (cp_attribute_table): Rename. objc: * objc-lang.c (LANG_HOOKS_COMMON_ATTRIBUTE_TABLE, LANG_HOOKS_FORMAT_ATTRIBUTE_TABLE): Redefine. From-SVN: r52730
This commit is contained in:
parent
3f2019c6ef
commit
349ae713cb
19 changed files with 1272 additions and 1201 deletions
|
@ -1,3 +1,55 @@
|
|||
2002-04-24 Neil Booth <neil@daikokuya.demon.co.uk>
|
||||
|
||||
* attribs.c (c_common_attribute_table): Move table and handlers
|
||||
to c-common.c.
|
||||
(format_attribute_table, lang_attribute_table,
|
||||
lang_attribute_common): Remove.
|
||||
(init_attributes): Replace NULL pointers with pointers to the
|
||||
empty table.
|
||||
(handle_packed_attribute, handle_nocommon_attribute,
|
||||
handle_common_attribute, handle_noreturn_attribute,
|
||||
handle_noinline_attribute, handle_always_inline_attribute,
|
||||
handle_used_attribute, handle_unused_attribute,
|
||||
handle_const_attribute, handle_transparent_union_attribute,
|
||||
handle_constructor_attribute, handle_destructor_attribute,
|
||||
handle_mode_attribute, handle_section_attribute,
|
||||
handle_aligned_attribute, handle_weak_attribute,
|
||||
handle_alias_attribute, handle_visibility_attribute,
|
||||
handle_no_instrument_function_attribute, handle_malloc_attribute,
|
||||
handle_no_limit_stack_attribute, handle_pure_attribute,
|
||||
handle_deprecated_attribute, handle_vector_size_attribute,
|
||||
vector_size_helper): Move to c-common.c.
|
||||
* c-common.c (c_common_attribute_table,
|
||||
handle_packed_attribute, handle_nocommon_attribute,
|
||||
handle_common_attribute, handle_noreturn_attribute,
|
||||
handle_noinline_attribute, handle_always_inline_attribute,
|
||||
handle_used_attribute, handle_unused_attribute,
|
||||
handle_const_attribute, handle_transparent_union_attribute,
|
||||
handle_constructor_attribute, handle_destructor_attribute,
|
||||
handle_mode_attribute, handle_section_attribute,
|
||||
handle_aligned_attribute, handle_weak_attribute,
|
||||
handle_alias_attribute, handle_visibility_attribute,
|
||||
handle_no_instrument_function_attribute, handle_malloc_attribute,
|
||||
handle_no_limit_stack_attribute, handle_pure_attribute,
|
||||
handle_deprecated_attribute, handle_vector_size_attribute,
|
||||
vector_size_helper): Move from attribs.c.
|
||||
* c-common.h (c_common_attribute_table,
|
||||
c_common_format_attribute_table): New.
|
||||
* c-lang.c (LANG_HOOKS_COMMON_ATTRIBUTE_TABLE,
|
||||
LANG_HOOKS_FORMAT_ATTRIBUTE_TABLE): Redefine.
|
||||
* langhooks-def.h (LANG_HOOKS_FORMAT_ATTRIBUTE_TABLE,
|
||||
LANG_HOOKS_COMMON_ATTRIBUTE_TABLE, LANG_HOOKS_ATTRIBUTE_TABLE): New.
|
||||
(LANG_HOOKS_INITIALIZER): Update.
|
||||
* langhooks.h (struct lang_hooks): 3 new attribute hooks.
|
||||
* target-def.h (TARGET_ATTRIBUTE_TABLE): Default to NULL.
|
||||
* target.h: Update comment.
|
||||
* tree.c (default_target_attribute_table): Remove.
|
||||
* tree.h (default_target_attribute_table, format_attribute_table,
|
||||
lang_attribute_table, lang_attribute_common): Remove.
|
||||
objc:
|
||||
* objc-lang.c (LANG_HOOKS_COMMON_ATTRIBUTE_TABLE,
|
||||
LANG_HOOKS_FORMAT_ATTRIBUTE_TABLE): Redefine.
|
||||
|
||||
2002-04-24 Jason Merrill <jason@redhat.com>
|
||||
|
||||
* dwarf2.h (enum dwarf_attribute): Add DW_AT_GNU_vector.
|
||||
|
|
|
@ -1,3 +1,7 @@
|
|||
2002-04-24 Neil Booth <neil@daikokuya.demon.co.uk>
|
||||
|
||||
* misc.c (gnat_init): Don't set lang_attribute_common.
|
||||
|
||||
2002-04-21 Joseph S. Myers <jsm28@cam.ac.uk>
|
||||
|
||||
* gnat_rm.texi: Use @ifnottex instead of @ifinfo.
|
||||
|
|
|
@ -388,9 +388,6 @@ gnat_init (filename)
|
|||
/* Show that REFERENCE_TYPEs are internal and should be Pmode. */
|
||||
internal_reference_types ();
|
||||
|
||||
/* Show we don't use the common language attributes. */
|
||||
lang_attribute_common = 0;
|
||||
|
||||
set_lang_adjust_rli (gnat_adjust_rli);
|
||||
return filename;
|
||||
}
|
||||
|
|
1162
gcc/attribs.c
1162
gcc/attribs.c
File diff suppressed because it is too large
Load diff
1168
gcc/c-common.c
1168
gcc/c-common.c
File diff suppressed because it is too large
Load diff
|
@ -484,6 +484,10 @@ extern int warn_long_long;
|
|||
what operator was specified for it. */
|
||||
#define C_EXP_ORIGINAL_CODE(exp) ((enum tree_code) TREE_COMPLEXITY (exp))
|
||||
|
||||
/* Attribute table common to the C front ends. */
|
||||
extern const struct attribute_spec c_common_attribute_table[];
|
||||
extern const struct attribute_spec c_common_format_attribute_table[];
|
||||
|
||||
/* Pointer to function to lazily generate the VAR_DECL for __FUNCTION__ etc.
|
||||
ID is the identifier to use, NAME is the string.
|
||||
TYPE_DEP indicates whether it depends on type of the function or not
|
||||
|
|
|
@ -83,6 +83,12 @@ static void c_post_options PARAMS ((void));
|
|||
#undef LANG_HOOKS_DUP_LANG_SPECIFIC_DECL
|
||||
#define LANG_HOOKS_DUP_LANG_SPECIFIC_DECL c_dup_lang_specific_decl
|
||||
|
||||
/* Attribute hooks. */
|
||||
#undef LANG_HOOKS_COMMON_ATTRIBUTE_TABLE
|
||||
#define LANG_HOOKS_COMMON_ATTRIBUTE_TABLE c_common_attribute_table
|
||||
#undef LANG_HOOKS_FORMAT_ATTRIBUTE_TABLE
|
||||
#define LANG_HOOKS_FORMAT_ATTRIBUTE_TABLE c_common_format_attribute_table
|
||||
|
||||
#undef LANG_HOOKS_TREE_INLINING_CANNOT_INLINE_TREE_FN
|
||||
#define LANG_HOOKS_TREE_INLINING_CANNOT_INLINE_TREE_FN \
|
||||
c_cannot_inline_tree_fn
|
||||
|
|
|
@ -1,3 +1,13 @@
|
|||
2002-04-24 Neil Booth <neil@daikokuya.demon.co.uk>
|
||||
|
||||
* cp-lang.c (LANG_HOOKS_COMMON_ATTRIBUTE_TABLE,
|
||||
LANG_HOOKS_FORMAT_ATTRIBUTE_TABLE, LANG_HOOKS_ATTRIBUTE_TABLE):
|
||||
Redefine.
|
||||
* cp-tree.h (cp_attribute_table): Rename.
|
||||
* decl.c (lang_attribute_table): Remove declaration.
|
||||
(cxx_init_decl_processing): Don't set it.
|
||||
* tree.c (cp_attribute_table): Rename.
|
||||
|
||||
2002-04-24 Jason Merrill <jason@redhat.com>
|
||||
|
||||
PR c++/6331
|
||||
|
|
|
@ -100,6 +100,14 @@ static bool cxx_warn_unused_global_decl PARAMS ((tree));
|
|||
#undef LANG_HOOKS_FUNCTION_MARK
|
||||
#define LANG_HOOKS_FUNCTION_MARK cxx_mark_function_context
|
||||
|
||||
/* Attribute hooks. */
|
||||
#undef LANG_HOOKS_COMMON_ATTRIBUTE_TABLE
|
||||
#define LANG_HOOKS_COMMON_ATTRIBUTE_TABLE c_common_attribute_table
|
||||
#undef LANG_HOOKS_FORMAT_ATTRIBUTE_TABLE
|
||||
#define LANG_HOOKS_FORMAT_ATTRIBUTE_TABLE c_common_format_attribute_table
|
||||
#undef LANG_HOOKS_ATTRIBUTE_TABLE
|
||||
#define LANG_HOOKS_ATTRIBUTE_TABLE cxx_attribute_table
|
||||
|
||||
#undef LANG_HOOKS_TREE_INLINING_WALK_SUBTREES
|
||||
#define LANG_HOOKS_TREE_INLINING_WALK_SUBTREES \
|
||||
cp_walk_subtrees
|
||||
|
|
|
@ -4287,7 +4287,7 @@ extern void debug_binfo PARAMS ((tree));
|
|||
extern tree build_dummy_object PARAMS ((tree));
|
||||
extern tree maybe_dummy_object PARAMS ((tree, tree *));
|
||||
extern int is_dummy_object PARAMS ((tree));
|
||||
extern const struct attribute_spec cp_attribute_table[];
|
||||
extern const struct attribute_spec cxx_attribute_table[];
|
||||
extern tree make_ptrmem_cst PARAMS ((tree, tree));
|
||||
extern tree cp_build_qualified_type_real PARAMS ((tree, int, tsubst_flags_t));
|
||||
#define cp_build_qualified_type(TYPE, QUALS) \
|
||||
|
|
|
@ -49,8 +49,6 @@ Boston, MA 02111-1307, USA. */
|
|||
#include "c-pragma.h"
|
||||
#include "diagnostic.h"
|
||||
|
||||
extern const struct attribute_spec *lang_attribute_table;
|
||||
|
||||
#ifndef BOOL_TYPE_SIZE
|
||||
/* `bool' has size and alignment `1', on all platforms. */
|
||||
#define BOOL_TYPE_SIZE CHAR_TYPE_SIZE
|
||||
|
@ -6531,8 +6529,6 @@ cxx_init_decl_processing ()
|
|||
std_node = current_namespace;
|
||||
pop_namespace ();
|
||||
|
||||
lang_attribute_table = cp_attribute_table;
|
||||
|
||||
c_common_nodes_and_builtins ();
|
||||
|
||||
java_byte_type_node = record_builtin_java_type ("__java_byte", 8);
|
||||
|
|
|
@ -1895,7 +1895,7 @@ pod_type_p (t)
|
|||
}
|
||||
|
||||
/* Table of valid C++ attributes. */
|
||||
const struct attribute_spec cp_attribute_table[] =
|
||||
const struct attribute_spec cxx_attribute_table[] =
|
||||
{
|
||||
/* { name, min_len, max_len, decl_req, type_req, fn_type_req, handler } */
|
||||
{ "java_interface", 0, 0, false, false, false, handle_java_interface_attribute },
|
||||
|
|
|
@ -116,6 +116,11 @@ tree lhd_tree_inlining_convert_parm_for_inlining PARAMS ((tree, tree, tree));
|
|||
#define LANG_HOOKS_FUNCTION_LEAVE_NESTED lhd_do_nothing_f
|
||||
#define LANG_HOOKS_FUNCTION_MARK lhd_do_nothing_f
|
||||
|
||||
/* Attribute hooks. */
|
||||
#define LANG_HOOKS_ATTRIBUTE_TABLE NULL
|
||||
#define LANG_HOOKS_COMMON_ATTRIBUTE_TABLE NULL
|
||||
#define LANG_HOOKS_FORMAT_ATTRIBUTE_TABLE NULL
|
||||
|
||||
/* Tree inlining hooks. */
|
||||
#define LANG_HOOKS_TREE_INLINING_WALK_SUBTREES lhd_tree_inlining_walk_subtrees
|
||||
#define LANG_HOOKS_TREE_INLINING_CANNOT_INLINE_TREE_FN \
|
||||
|
@ -246,6 +251,9 @@ int lhd_tree_dump_type_quals PARAMS ((tree));
|
|||
LANG_HOOKS_DECL_PRINTABLE_NAME, \
|
||||
LANG_HOOKS_PRINT_ERROR_FUNCTION, \
|
||||
LANG_HOOKS_SET_YYDEBUG, \
|
||||
LANG_HOOKS_ATTRIBUTE_TABLE, \
|
||||
LANG_HOOKS_COMMON_ATTRIBUTE_TABLE, \
|
||||
LANG_HOOKS_FORMAT_ATTRIBUTE_TABLE, \
|
||||
LANG_HOOKS_FUNCTION_INITIALIZER, \
|
||||
LANG_HOOKS_TREE_INLINING_INITIALIZER, \
|
||||
LANG_HOOKS_TREE_DUMP_INITIALIZER, \
|
||||
|
|
|
@ -332,6 +332,15 @@ struct lang_hooks
|
|||
warning that the front end does not use such a parser. */
|
||||
void (*set_yydebug) PARAMS ((int));
|
||||
|
||||
/* Pointers to machine-independent attribute tables, for front ends
|
||||
using attribs.c. If one is NULL, it is ignored. Respectively, a
|
||||
table of attributes specific to the language, a table of
|
||||
attributes common to two or more languages (to allow easy
|
||||
sharing), and a table of attributes for checking formats. */
|
||||
const struct attribute_spec *attribute_table;
|
||||
const struct attribute_spec *common_attribute_table;
|
||||
const struct attribute_spec *format_attribute_table;
|
||||
|
||||
/* Function-related language hooks. */
|
||||
struct lang_hooks_for_functions function;
|
||||
|
||||
|
|
|
@ -80,6 +80,12 @@ static void objc_post_options PARAMS ((void));
|
|||
#undef LANG_HOOKS_FUNCTION_MARK
|
||||
#define LANG_HOOKS_FUNCTION_MARK c_mark_function_context
|
||||
|
||||
/* Attribute hooks. */
|
||||
#undef LANG_HOOKS_COMMON_ATTRIBUTE_TABLE
|
||||
#define LANG_HOOKS_COMMON_ATTRIBUTE_TABLE c_common_attribute_table
|
||||
#undef LANG_HOOKS_FORMAT_ATTRIBUTE_TABLE
|
||||
#define LANG_HOOKS_FORMAT_ATTRIBUTE_TABLE c_common_format_attribute_table
|
||||
|
||||
/* Inlining hooks same as the C front end. */
|
||||
#undef LANG_HOOKS_TREE_INLINING_CANNOT_INLINE_TREE_FN
|
||||
#define LANG_HOOKS_TREE_INLINING_CANNOT_INLINE_TREE_FN \
|
||||
|
|
|
@ -159,7 +159,7 @@ Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|||
/* All in tree.c. */
|
||||
#define TARGET_MERGE_DECL_ATTRIBUTES merge_decl_attributes
|
||||
#define TARGET_MERGE_TYPE_ATTRIBUTES merge_type_attributes
|
||||
#define TARGET_ATTRIBUTE_TABLE default_target_attribute_table
|
||||
#define TARGET_ATTRIBUTE_TABLE NULL
|
||||
#define TARGET_COMP_TYPE_ATTRIBUTES default_comp_type_attributes
|
||||
#define TARGET_SET_DEFAULT_TYPE_ATTRIBUTES default_set_default_type_attributes
|
||||
#define TARGET_INSERT_ATTRIBUTES default_insert_attributes
|
||||
|
|
|
@ -144,7 +144,8 @@ struct gcc_target
|
|||
/* Given two types, merge their attributes and return the result. */
|
||||
tree (* merge_type_attributes) PARAMS ((tree, tree));
|
||||
|
||||
/* Table of machine attributes and functions to handle them. */
|
||||
/* Table of machine attributes and functions to handle them.
|
||||
Ignored if NULL. */
|
||||
const struct attribute_spec *attribute_table;
|
||||
|
||||
/* Return zero if the attributes on TYPE1 and TYPE2 are incompatible,
|
||||
|
|
|
@ -2570,12 +2570,6 @@ default_insert_attributes (decl, attr_ptr)
|
|||
{
|
||||
}
|
||||
|
||||
/* Default value of targetm.attribute_table that is empty. */
|
||||
const struct attribute_spec default_target_attribute_table[] =
|
||||
{
|
||||
{ NULL, 0, 0, false, false, false, NULL }
|
||||
};
|
||||
|
||||
/* Default value of targetm.function_attribute_inlinable_p that always
|
||||
returns false. */
|
||||
bool
|
||||
|
|
14
gcc/tree.h
14
gcc/tree.h
|
@ -2221,8 +2221,6 @@ struct attribute_spec
|
|||
int flags, bool *no_add_attrs));
|
||||
};
|
||||
|
||||
extern const struct attribute_spec default_target_attribute_table[];
|
||||
|
||||
/* Flags that may be passed in the third argument of decl_attributes, and
|
||||
to handler functions for attributes. */
|
||||
enum attribute_flags
|
||||
|
@ -2926,18 +2924,6 @@ extern int setjmp_call_p PARAMS ((tree));
|
|||
a decl attribute to the declaration rather than to its type). */
|
||||
extern tree decl_attributes PARAMS ((tree *, tree, int));
|
||||
|
||||
/* The following function must be provided by front ends
|
||||
using attribs.c. */
|
||||
|
||||
/* Table of machine-independent attributes for checking formats, if used. */
|
||||
extern const struct attribute_spec *format_attribute_table;
|
||||
|
||||
/* Table of machine-independent attributes for a particular language. */
|
||||
extern const struct attribute_spec *lang_attribute_table;
|
||||
|
||||
/* Flag saying whether common language attributes are to be supported. */
|
||||
extern int lang_attribute_common;
|
||||
|
||||
/* In integrate.c */
|
||||
extern void save_for_inline PARAMS ((tree));
|
||||
extern void set_decl_abstract_flags PARAMS ((tree, int));
|
||||
|
|
Loading…
Add table
Reference in a new issue