+2001-07-08 Joseph S. Myers <jsm28@cam.ac.uk>
+
+ * c-common.c (decl_attributes): Only take a single attributes
+ parameter.
+ * c-common.h (decl_attributes): Update prototype.
+ * c-decl.c (start_decl, start_function): Only take a single
+ attributes parameter. Update calls to decl_attributes.
+ (finish_struct, finish_enum): Update calls to decl_attributes.
+ (push_parm_decl): Expect unified list of attributes. Update call
+ to decl_attributes.
+ * c-parse.in (fndef, initdcl, notype_initdcl, nested_function,
+ notype_nested_function, component_declarator,
+ component_notype_declarator, label): Update calls to
+ decl_attributes.
+ (absdcl_maybe_attribute, parm, firstparm, myparm): Unify attribute
+ lists that are passed to push_parm_decl.
+ * c-tree.h (start_function, start_decl): Update prototypes.
+ * config/sh/sh-protos.h, config/sh/sh.c
+ (sh_pragma_insert_attributes): Only take a single attributes
+ parameter.
+ * config/sh/sh.h (PRAGMA_INSERT_ATTRIBUTES): Likewise.
+ * doc/tm.texi (INSERT_ATTRIBUTES): Update.
+ * objc/objc-act.c (define_decl, generate_objc_symtab_decl,
+ build_module_descriptor, generate_static_references,
+ generate_strings, build_selector_translation_table,
+ generate_descriptor_table, generate_protocols,
+ generate_ivars_list, generate_dispatch_table,
+ generate_protocol_list, generate_category,
+ generate_shared_structures, really_start_method, add_objc_decls,
+ generate_classref_translation_entry): Update calls to start_decl
+ and start_function.
+ (build_tmp_function_decl, start_method_def): Unify attribute lists
+ that are passed to push_parm_decl.
+
2001-07-08 Neil Booth <neil@daikokuya.demon.co.uk>
* final.c (no_asm_to_stream): New.
int (*valid_lang_attribute) PARAMS ((tree, tree, tree, tree))
= default_valid_lang_attribute;
-/* Process the attributes listed in ATTRIBUTES and PREFIX_ATTRIBUTES
- and install them in NODE, which is either a DECL (including a TYPE_DECL)
- or a TYPE. PREFIX_ATTRIBUTES can appear after the declaration specifiers
- and declaration modifiers but before the declaration proper. */
+/* Process the attributes listed in ATTRIBUTES and install them in NODE,
+ which is either a DECL (including a TYPE_DECL) or a TYPE. */
void
-decl_attributes (node, attributes, prefix_attributes)
- tree node, attributes, prefix_attributes;
+decl_attributes (node, attributes)
+ tree node, attributes;
{
tree decl = 0, type = 0;
int is_type = 0;
allow it to do so. Do this before allowing machine back ends to
insert attributes, so that they have the opportunity to override
anything done here. */
- PRAGMA_INSERT_ATTRIBUTES (node, & attributes, & prefix_attributes);
+ PRAGMA_INSERT_ATTRIBUTES (node, & attributes);
#endif
#ifdef INSERT_ATTRIBUTES
- INSERT_ATTRIBUTES (node, & attributes, & prefix_attributes);
+ INSERT_ATTRIBUTES (node, & attributes);
#endif
- attributes = chainon (prefix_attributes, attributes);
-
for (a = attributes; a; a = TREE_CHAIN (a))
{
tree name = TREE_PURPOSE (a);
extern const char *fname_as_string PARAMS ((int));
extern tree fname_decl PARAMS ((unsigned, tree));
extern const char *fname_string PARAMS ((unsigned));
-extern void decl_attributes PARAMS ((tree, tree, tree));
+extern void decl_attributes PARAMS ((tree, tree));
extern void init_function_format_info PARAMS ((void));
extern void check_function_format PARAMS ((int *, tree, tree, tree));
extern void set_Wformat PARAMS ((int));
grokfield and not through here. */
tree
-start_decl (declarator, declspecs, initialized, attributes, prefix_attributes)
+start_decl (declarator, declspecs, initialized, attributes)
tree declarator, declspecs;
int initialized;
- tree attributes, prefix_attributes;
+ tree attributes;
{
register tree decl = grokdeclarator (declarator, declspecs,
NORMAL, initialized);
#endif
/* Set attributes here so if duplicate decl, will have proper attributes. */
- decl_attributes (decl, attributes, prefix_attributes);
+ decl_attributes (decl, attributes);
/* Add this decl to the current binding level.
TEM may equal DECL or it may be a previous decl of the same name. */
decl = grokdeclarator (TREE_VALUE (TREE_PURPOSE (parm)),
TREE_PURPOSE (TREE_PURPOSE (parm)), PARM, 0);
- decl_attributes (decl, TREE_VALUE (TREE_VALUE (parm)),
- TREE_PURPOSE (TREE_VALUE (parm)));
+ decl_attributes (decl, TREE_VALUE (parm));
#if 0
if (DECL_NAME (decl))
TYPE_SIZE (t) = 0;
- decl_attributes (t, attributes, NULL_TREE);
+ decl_attributes (t, attributes);
/* Nameless union parm types are useful as GCC extension. */
if (! (TREE_CODE (t) == UNION_TYPE && TYPE_NAME (t) == 0) && !pedantic)
if (in_parm_level_p ())
warning ("enum defined inside parms");
- decl_attributes (enumtype, attributes, NULL_TREE);
+ decl_attributes (enumtype, attributes);
/* Calculate the maximum value of any enumerator in this type. */
\f
/* Create the FUNCTION_DECL for a function definition.
- DECLSPECS, DECLARATOR, PREFIX_ATTRIBUTES and ATTRIBUTES are the parts of
+ DECLSPECS, DECLARATOR and ATTRIBUTES are the parts of
the declaration; they describe the function's name and the type it returns,
but twisted together in a fashion that parallels the syntax of C.
yyparse to report a parse error. */
int
-start_function (declspecs, declarator, prefix_attributes, attributes)
- tree declarator, declspecs, prefix_attributes, attributes;
+start_function (declspecs, declarator, attributes)
+ tree declarator, declspecs, attributes;
{
tree decl1, old_decl;
tree restype;
return 0;
}
- decl_attributes (decl1, prefix_attributes, attributes);
+ decl_attributes (decl1, attributes);
announce_function (decl1);
fndef:
declspecs_ts setspecs declarator
{ if (! start_function (current_declspecs, $3,
- prefix_attributes, NULL_TREE))
+ prefix_attributes))
YYERROR1;
}
old_style_parm_decls
declspec_stack = TREE_CHAIN (declspec_stack); }
| declspecs_nots setspecs notype_declarator
{ if (! start_function (current_declspecs, $3,
- prefix_attributes, NULL_TREE))
+ prefix_attributes))
YYERROR1;
}
old_style_parm_decls
declspec_stack = TREE_CHAIN (declspec_stack); }
| setspecs notype_declarator
{ if (! start_function (NULL_TREE, $2,
- prefix_attributes, NULL_TREE))
+ prefix_attributes))
YYERROR1;
}
old_style_parm_decls
initdcl:
declarator maybeasm maybe_attribute '='
{ $<ttype>$ = start_decl ($1, current_declspecs, 1,
- $3, prefix_attributes);
+ chainon ($3, prefix_attributes));
start_init ($<ttype>$, $2, global_bindings_p ()); }
init
/* Note how the declaration of the variable is in effect while its init is parsed! */
finish_decl ($<ttype>5, $6, $2); }
| declarator maybeasm maybe_attribute
{ tree d = start_decl ($1, current_declspecs, 0,
- $3, prefix_attributes);
+ chainon ($3, prefix_attributes));
finish_decl (d, NULL_TREE, $2);
}
;
notype_initdcl:
notype_declarator maybeasm maybe_attribute '='
{ $<ttype>$ = start_decl ($1, current_declspecs, 1,
- $3, prefix_attributes);
+ chainon ($3, prefix_attributes));
start_init ($<ttype>$, $2, global_bindings_p ()); }
init
/* Note how the declaration of the variable is in effect while its init is parsed! */
finish_decl ($<ttype>5, $6, $2); }
| notype_declarator maybeasm maybe_attribute
{ tree d = start_decl ($1, current_declspecs, 0,
- $3, prefix_attributes);
+ chainon ($3, prefix_attributes));
finish_decl (d, NULL_TREE, $2); }
;
/* the * rules are dummies to accept the Apollo extended syntax
push_function_context ();
if (! start_function (current_declspecs, $1,
- prefix_attributes, NULL_TREE))
+ prefix_attributes))
{
pop_function_context ();
YYERROR1;
push_function_context ();
if (! start_function (current_declspecs, $1,
- prefix_attributes, NULL_TREE))
+ prefix_attributes))
{
pop_function_context ();
YYERROR1;
component_declarator:
save_filename save_lineno declarator maybe_attribute
{ $$ = grokfield ($1, $2, $3, current_declspecs, NULL_TREE);
- decl_attributes ($$, $4, prefix_attributes); }
+ decl_attributes ($$, chainon ($4, prefix_attributes)); }
| save_filename save_lineno
declarator ':' expr_no_commas maybe_attribute
{ $$ = grokfield ($1, $2, $3, current_declspecs, $5);
- decl_attributes ($$, $6, prefix_attributes); }
+ decl_attributes ($$, chainon ($6, prefix_attributes)); }
| save_filename save_lineno ':' expr_no_commas maybe_attribute
{ $$ = grokfield ($1, $2, NULL_TREE, current_declspecs, $4);
- decl_attributes ($$, $5, prefix_attributes); }
+ decl_attributes ($$, chainon ($5, prefix_attributes)); }
;
component_notype_declarator:
save_filename save_lineno notype_declarator maybe_attribute
{ $$ = grokfield ($1, $2, $3, current_declspecs, NULL_TREE);
- decl_attributes ($$, $4, prefix_attributes); }
+ decl_attributes ($$, chainon ($4, prefix_attributes)); }
| save_filename save_lineno
notype_declarator ':' expr_no_commas maybe_attribute
{ $$ = grokfield ($1, $2, $3, current_declspecs, $5);
- decl_attributes ($$, $6, prefix_attributes); }
+ decl_attributes ($$, chainon ($6, prefix_attributes)); }
| save_filename save_lineno ':' expr_no_commas maybe_attribute
{ $$ = grokfield ($1, $2, NULL_TREE, current_declspecs, $4);
- decl_attributes ($$, $5, prefix_attributes); }
+ decl_attributes ($$, chainon ($5, prefix_attributes)); }
;
/* We chain the enumerators in reverse order.
/* empty */
{ $$ = build_tree_list (build_tree_list (current_declspecs,
NULL_TREE),
- build_tree_list (prefix_attributes,
- NULL_TREE)); }
+ prefix_attributes); }
| absdcl1
{ $$ = build_tree_list (build_tree_list (current_declspecs,
$1),
- build_tree_list (prefix_attributes,
- NULL_TREE)); }
+ prefix_attributes); }
| absdcl1_noea attributes
{ $$ = build_tree_list (build_tree_list (current_declspecs,
$1),
- build_tree_list (prefix_attributes,
- $2)); }
+ chainon ($2, prefix_attributes)); }
;
absdcl1: /* a nonempty absolute declarator */
stmt_count++;
if (label)
{
- decl_attributes (label, $5, NULL_TREE);
+ decl_attributes (label, $5);
$$ = add_stmt (build_stmt (LABEL_STMT, label));
}
else
declspecs_ts setspecs parm_declarator maybe_attribute
{ $$ = build_tree_list (build_tree_list (current_declspecs,
$3),
- build_tree_list (prefix_attributes,
- $4));
+ chainon ($4, prefix_attributes));
current_declspecs = TREE_VALUE (declspec_stack);
prefix_attributes = TREE_PURPOSE (declspec_stack);
declspec_stack = TREE_CHAIN (declspec_stack); }
| declspecs_ts setspecs notype_declarator maybe_attribute
{ $$ = build_tree_list (build_tree_list (current_declspecs,
$3),
- build_tree_list (prefix_attributes,
- $4));
+ chainon ($4, prefix_attributes));
current_declspecs = TREE_VALUE (declspec_stack);
prefix_attributes = TREE_PURPOSE (declspec_stack);
declspec_stack = TREE_CHAIN (declspec_stack); }
| declspecs_nots setspecs notype_declarator maybe_attribute
{ $$ = build_tree_list (build_tree_list (current_declspecs,
$3),
- build_tree_list (prefix_attributes,
- $4));
+ chainon ($4, prefix_attributes));
current_declspecs = TREE_VALUE (declspec_stack);
prefix_attributes = TREE_PURPOSE (declspec_stack);
declspec_stack = TREE_CHAIN (declspec_stack); }
declspecs_ts_nosa setspecs_fp parm_declarator maybe_attribute
{ $$ = build_tree_list (build_tree_list (current_declspecs,
$3),
- build_tree_list (prefix_attributes,
- $4));
+ chainon ($4, prefix_attributes));
current_declspecs = TREE_VALUE (declspec_stack);
prefix_attributes = TREE_PURPOSE (declspec_stack);
declspec_stack = TREE_CHAIN (declspec_stack); }
| declspecs_ts_nosa setspecs_fp notype_declarator maybe_attribute
{ $$ = build_tree_list (build_tree_list (current_declspecs,
$3),
- build_tree_list (prefix_attributes,
- $4));
+ chainon ($4, prefix_attributes));
current_declspecs = TREE_VALUE (declspec_stack);
prefix_attributes = TREE_PURPOSE (declspec_stack);
declspec_stack = TREE_CHAIN (declspec_stack); }
| declspecs_nots_nosa setspecs_fp notype_declarator maybe_attribute
{ $$ = build_tree_list (build_tree_list (current_declspecs,
$3),
- build_tree_list (prefix_attributes,
- $4));
+ chainon ($4, prefix_attributes));
current_declspecs = TREE_VALUE (declspec_stack);
prefix_attributes = TREE_PURPOSE (declspec_stack);
declspec_stack = TREE_CHAIN (declspec_stack); }
parm_declarator maybe_attribute
{ $$ = build_tree_list (build_tree_list (current_declspecs,
$1),
- build_tree_list (prefix_attributes,
- $2)); }
+ chainon ($2, prefix_attributes)); }
| notype_declarator maybe_attribute
{ $$ = build_tree_list (build_tree_list (current_declspecs,
$1),
- build_tree_list (prefix_attributes,
- $2)); }
+ chainon ($2, prefix_attributes)); }
| absdcl_maybe_attribute
{ $$ = $1; }
;
extern void shadow_tag PARAMS ((tree));
extern void shadow_tag_warned PARAMS ((tree, int));
extern tree start_enum PARAMS ((tree));
-extern int start_function PARAMS ((tree, tree, tree,
- tree));
+extern int start_function PARAMS ((tree, tree, tree));
extern tree start_decl PARAMS ((tree, tree, int,
- tree, tree));
+ tree));
extern tree start_struct PARAMS ((enum tree_code, tree));
extern void store_parm_decls PARAMS ((void));
extern tree xref_tag PARAMS ((enum tree_code, tree));
#endif /* RTX_CODE */
#ifdef TREE_CODE
-extern void sh_pragma_insert_attributes PARAMS ((tree, tree *, tree *));
+extern void sh_pragma_insert_attributes PARAMS ((tree, tree *));
extern tree sh_build_va_list PARAMS ((void));
#endif /* TREE_CODE */
/* Generate 'handle_interrupt' attribute for decls */
void
-sh_pragma_insert_attributes (node, attributes, prefix)
+sh_pragma_insert_attributes (node, attributes)
tree node;
tree * attributes;
- tree * prefix ATTRIBUTE_UNUSED;
{
if (! pragma_interrupt
|| TREE_CODE (node) != FUNCTION_DECL)
for interrupt functions. */
extern struct rtx_def *sp_switch;
-#define PRAGMA_INSERT_ATTRIBUTES(node, pattr, prefix_attr) \
- sh_pragma_insert_attributes (node, pattr, prefix_attr)
+#define PRAGMA_INSERT_ATTRIBUTES(node, pattr) \
+ sh_pragma_insert_attributes (node, pattr)
extern int rtx_equal_function_value_matters;
extern struct rtx_def *fpscr_rtx;
+2001-07-08 Joseph S. Myers <jsm28@cam.ac.uk>
+
+ * decl.c (grokdeclarator), decl2.c (cplus_decl_attributes): Update
+ calls to decl_attributes.
+
2001-07-06 Ira Ruben <ira@apple.com>
* cp-tree.def (TEMPLATE_DECL): Update comment. DECL_RESULT should
ignore_attrs = 0;
else if (inner_attrs)
{
- decl_attributes (type, inner_attrs, NULL_TREE);
+ decl_attributes (type, inner_attrs);
inner_attrs = NULL_TREE;
}
if (inner_attrs)
{
if (! ignore_attrs)
- decl_attributes (type, inner_attrs, NULL_TREE);
+ decl_attributes (type, inner_attrs);
else if (attrlist)
TREE_VALUE (attrlist) = chainon (inner_attrs, TREE_VALUE (attrlist));
else
if (TREE_CODE (decl) == TEMPLATE_DECL)
decl = DECL_TEMPLATE_RESULT (decl);
- decl_attributes (decl, attributes, prefix_attributes);
+ decl_attributes (decl, chainon (attributes, prefix_attributes));
if (TREE_CODE (decl) == TYPE_DECL)
SET_IDENTIFIER_TYPE_VALUE (DECL_NAME (decl), TREE_TYPE (decl));
@table @code
@findex INSERT_ATTRIBUTES
-@item INSERT_ATTRIBUTES (@var{node}, @var{attr_ptr}, @var{prefix_ptr})
+@item INSERT_ATTRIBUTES (@var{node}, @var{attr_ptr})
Define this macro if you want to be able to add attributes to a decl
when it is being created. This is normally useful for back ends which
wish to implement a pragma by using the attributes which correspond to
the pragma's effect. The @var{node} argument is the decl which is being
created. The @var{attr_ptr} argument is a pointer to the attribute list
-for this decl. The @var{prefix_ptr} is a pointer to the list of
-attributes that have appeared after the specifiers and modifiers of the
-declaration, but before the declaration proper.
+for this decl. The list itself should not be modified, since it may be
+shared with other decls, but attributes may be chained on the head of
+the list and @code{*@var{attr_ptr}} modified to point to the new
+attributes, or a copy of the list may be made if further changes are
+needed.
@findex SET_DEFAULT_DECL_ATTRIBUTES
@item SET_DEFAULT_DECL_ATTRIBUTES (@var{decl}, @var{attributes})
tree declarator;
tree declspecs;
{
- tree decl = start_decl (declarator, declspecs, 0, NULL_TREE, NULL_TREE);
+ tree decl = start_decl (declarator, declspecs, 0, NULL_TREE);
finish_decl (decl, NULL_TREE, NULL_TREE);
return decl;
}
tree_cons (NULL_TREE,
objc_symtab_template, sc_spec),
1,
- NULL_TREE, NULL_TREE);
+ NULL_TREE);
TREE_USED (UOBJC_SYMBOLS_decl) = 1;
DECL_IGNORED_P (UOBJC_SYMBOLS_decl) = 1;
ridpointers[(int) RID_STATIC]));
UOBJC_MODULES_decl = start_decl (get_identifier ("_OBJC_MODULES"),
- decl_specs, 1, NULL_TREE, NULL_TREE);
+ decl_specs, 1, NULL_TREE);
DECL_ARTIFICIAL (UOBJC_MODULES_decl) = 1;
DECL_IGNORED_P (UOBJC_MODULES_decl) = 1;
tree_cons (NULL_TREE, NULL_TREE,
void_list_node_1),
NULL_TREE),
- NULL_TREE, NULL_TREE);
+ NULL_TREE);
#if 0 /* This should be turned back on later
for the systems where collect is not needed. */
/* Make these functions nonglobal
decl_spec = tree_cons (NULL_TREE, build_pointer_type (void_type_node),
build_tree_list (NULL_TREE,
ridpointers[(int) RID_STATIC]));
- decl = start_decl (expr_decl, decl_spec, 1, NULL_TREE, NULL_TREE);
+ decl = start_decl (expr_decl, decl_spec, 1, NULL_TREE);
DECL_CONTEXT (decl) = 0;
DECL_ARTIFICIAL (decl) = 1;
build_tree_list (NULL_TREE,
ridpointers[(int) RID_STATIC]));
static_instances_decl
- = start_decl (expr_decl, decl_spec, 1, NULL_TREE, NULL_TREE);
+ = start_decl (expr_decl, decl_spec, 1, NULL_TREE);
TREE_USED (static_instances_decl) = 1;
DECL_CONTEXT (static_instances_decl) = 0;
DECL_ARTIFICIAL (static_instances_decl) = 1;
= tree_cons (NULL_TREE, ridpointers[(int) RID_STATIC], NULL_TREE);
decl_specs = tree_cons (NULL_TREE, ridpointers[(int) RID_CHAR], sc_spec);
expr_decl = build_nt (ARRAY_REF, DECL_NAME (decl), NULL_TREE);
- decl = start_decl (expr_decl, decl_specs, 1, NULL_TREE, NULL_TREE);
+ decl = start_decl (expr_decl, decl_specs, 1, NULL_TREE);
DECL_CONTEXT (decl) = NULL_TREE;
string_expr = my_build_string (IDENTIFIER_LENGTH (string) + 1,
IDENTIFIER_POINTER (string));
= tree_cons (NULL_TREE, ridpointers[(int) RID_STATIC], NULL_TREE);
decl_specs = tree_cons (NULL_TREE, ridpointers[(int) RID_CHAR], sc_spec);
expr_decl = build_nt (ARRAY_REF, DECL_NAME (decl), NULL_TREE);
- decl = start_decl (expr_decl, decl_specs, 1, NULL_TREE, NULL_TREE);
+ decl = start_decl (expr_decl, decl_specs, 1, NULL_TREE);
DECL_CONTEXT (decl) = NULL_TREE;
string_expr = my_build_string (IDENTIFIER_LENGTH (string) + 1,
IDENTIFIER_POINTER (string));
= tree_cons (NULL_TREE, ridpointers[(int) RID_STATIC], NULL_TREE);
decl_specs = tree_cons (NULL_TREE, ridpointers[(int) RID_CHAR], sc_spec);
expr_decl = build_nt (ARRAY_REF, DECL_NAME (decl), NULL_TREE);
- decl = start_decl (expr_decl, decl_specs, 1, NULL_TREE, NULL_TREE);
+ decl = start_decl (expr_decl, decl_specs, 1, NULL_TREE);
DECL_CONTEXT (decl) = NULL_TREE;
string_expr = my_build_string (IDENTIFIER_LENGTH (string) + 1,
IDENTIFIER_POINTER (string));
/* The `decl' that is returned from start_decl is the one that we
forward declared in `build_selector_reference' */
- decl = start_decl (var_decl, decl_specs, 1, NULL_TREE, NULL_TREE);
+ decl = start_decl (var_decl, decl_specs, 1, NULL_TREE );
}
/* add one for the '\0' character */
decl_specs = tree_cons (NULL_TREE, type, sc_spec);
decl = start_decl (synth_id_with_class_suffix (name, proto),
- decl_specs, 1, NULL_TREE, NULL_TREE);
+ decl_specs, 1, NULL_TREE);
DECL_CONTEXT (decl) = NULL_TREE;
initlist = build_tree_list (NULL_TREE, build_int_2 (size, 0));
(build_tree_list (decl_specs,
build1 (INDIRECT_REF, NULL_TREE,
NULL_TREE)),
- build_tree_list (NULL_TREE, NULL_TREE)));
+ NULL_TREE));
decl_specs = build_tree_list (NULL_TREE, xref_tag (RECORD_TYPE,
get_identifier (TAG_SELECTOR)));
expr_decl = build1 (INDIRECT_REF, NULL_TREE, NULL_TREE);
push_parm_decl (build_tree_list (build_tree_list (decl_specs, expr_decl),
- build_tree_list (NULL_TREE, NULL_TREE)));
+ NULL_TREE));
parms = get_parm_info (0);
poplevel (0, 0, 0);
decl_specs = tree_cons (NULL_TREE, objc_protocol_template, sc_spec);
decl = start_decl (synth_id_with_class_suffix ("_OBJC_PROTOCOL", p),
- decl_specs, 1, NULL_TREE, NULL_TREE);
+ decl_specs, 1, NULL_TREE);
DECL_CONTEXT (decl) = NULL_TREE;
decl_specs = tree_cons (NULL_TREE, type, sc_spec);
decl = start_decl (synth_id_with_class_suffix (name, implementation_context),
- decl_specs, 1, NULL_TREE, NULL_TREE);
+ decl_specs, 1, NULL_TREE);
initlist = build_tree_list (NULL_TREE, build_int_2 (size, 0));
initlist = tree_cons (NULL_TREE, list, initlist);
decl_specs = tree_cons (NULL_TREE, type, sc_spec);
decl = start_decl (synth_id_with_class_suffix (name, implementation_context),
- decl_specs, 1, NULL_TREE, NULL_TREE);
+ decl_specs, 1, NULL_TREE);
initlist = build_tree_list (NULL_TREE, build_int_2 (0, 0));
initlist = tree_cons (NULL_TREE, build_int_2 (size, 0), initlist);
expr_decl = build1 (INDIRECT_REF, NULL_TREE, expr_decl);
- refs_decl = start_decl (expr_decl, decl_specs, 1, NULL_TREE, NULL_TREE);
+ refs_decl = start_decl (expr_decl, decl_specs, 1, NULL_TREE);
DECL_CONTEXT (refs_decl) = NULL_TREE;
finish_decl (refs_decl, build_constructor (TREE_TYPE (refs_decl),
decl = start_decl (synth_id_with_class_suffix ("_OBJC_CATEGORY",
implementation_context),
- decl_specs, 1, NULL_TREE, NULL_TREE);
+ decl_specs, 1, NULL_TREE);
initlist = build_category_initializer (TREE_TYPE (decl),
cat_name_expr, class_name_expr,
decl_specs = tree_cons (NULL_TREE, objc_class_template, sc_spec);
decl = start_decl (DECL_NAME (UOBJC_METACLASS_decl), decl_specs, 1,
- NULL_TREE, NULL_TREE);
+ NULL_TREE);
initlist
= build_shared_structure_initializer
/* static struct objc_class _OBJC_CLASS_Foo={ ... }; */
decl = start_decl (DECL_NAME (UOBJC_CLASS_decl), decl_specs, 1,
- NULL_TREE, NULL_TREE);
+ NULL_TREE);
initlist
= build_shared_structure_initializer
push_parm_decl (build_tree_list
(build_tree_list (decl_specs,
build1 (INDIRECT_REF, NULL_TREE, self_id)),
- build_tree_list (unused_list, NULL_TREE)));
+ unused_list));
decl_specs = build_tree_list (NULL_TREE,
xref_tag (RECORD_TYPE,
push_parm_decl (build_tree_list
(build_tree_list (decl_specs,
build1 (INDIRECT_REF, NULL_TREE, ucmd_id)),
- build_tree_list (unused_list, NULL_TREE)));
+ unused_list));
/* Generate argument declarations if a keyword_decl. */
if (METHOD_SEL_ARGS (method))
TREE_OPERAND (last_expr, 0) = KEYWORD_ARG_NAME (arglist);
push_parm_decl (build_tree_list
(build_tree_list (arg_spec, arg_decl),
- build_tree_list (NULL_TREE, NULL_TREE)));
+ NULL_TREE));
/* Unhook: restore the abstract declarator. */
TREE_OPERAND (last_expr, 0) = NULL_TREE;
push_parm_decl (build_tree_list
(build_tree_list (arg_spec,
KEYWORD_ARG_NAME (arglist)),
- build_tree_list (NULL_TREE, NULL_TREE)));
+ NULL_TREE));
arglist = TREE_CHAIN (arglist);
}
method_decl = ret_decl;
/* Fool the parser into thinking it is starting a function. */
- start_function (decl_specs, method_decl, NULL_TREE, NULL_TREE);
+ start_function (decl_specs, method_decl, NULL_TREE);
/* Unhook: this has the effect of restoring the abstract declarator. */
TREE_OPERAND (save_expr, 0) = NULL_TREE;
TREE_VALUE (TREE_TYPE (method)) = method_decl;
/* Fool the parser into thinking it is starting a function. */
- start_function (decl_specs, method_decl, NULL_TREE, NULL_TREE);
+ start_function (decl_specs, method_decl, NULL_TREE);
/* Unhook: this has the effect of restoring the abstract declarator. */
TREE_VALUE (TREE_TYPE (method)) = NULL_TREE;
UOBJC_SUPER_decl = start_decl (get_identifier (UTAG_SUPER),
build_tree_list (NULL_TREE,
objc_super_template),
- 0, NULL_TREE, NULL_TREE);
+ 0, NULL_TREE);
finish_decl (UOBJC_SUPER_decl, NULL_TREE, NULL_TREE);
/* The decl that is returned from start_decl is the one that we
forward declared in build_class_reference. */
- decl = start_decl (name, decl_specs, 1, NULL_TREE, NULL_TREE);
+ decl = start_decl (name, decl_specs, 1, NULL_TREE);
DECL_CONTEXT (decl) = NULL_TREE;
finish_decl (decl, expr, NULL_TREE);
return;
+2001-07-08 Joseph S. Myers <jsm28@cam.ac.uk>
+
+ * gcc.c-torture/compile/20010701-1.c,
+ g++.old-deja/g++.ext/attrib6.C: New tests.
+
Fri Jul 6 09:31:43 2001 Jeffrey A Law (law@cygnus.com)
* gcc.c-torture/compile/20010706-1.c: New test.
--- /dev/null
+// Test that postfix attributes only apply to a single declared object.
+// (decl_attributes used to chain them onto the end of the prefix attributes,
+// which caused them to apply to other declarations as well.)
+// Origin: Joseph Myers <jsm28@cam.ac.uk>.
+// Build don't link:
+void __attribute__((__noreturn__)) foo (const char *, ...) __attribute__((__format__(__printf__, 1, 2))), bar (void);
--- /dev/null
+/* Test that postfix attributes only apply to a single declared object.
+ (decl_attributes used to chain them onto the end of the prefix attributes,
+ which caused them to apply to other declarations as well.) */
+/* Origin: Joseph Myers <jsm28@cam.ac.uk>. */
+void __attribute__((__noreturn__)) foo (const char *, ...) __attribute__((__format__(__printf__, 1, 2))), bar (void);