c-aux-info.c (gen_formal_list_for_type): Use prototype_p.

gcc/
	* c-aux-info.c (gen_formal_list_for_type): Use prototype_p.
	* c-decl.c (diagnose_arglist_conflict): Likewise.
	(diagnose_mismatched_decls, merge_decls): Likewise.
	(c_builtin_function, c_builtin_function_ext_scope): Likewise.
	(start_decl, start_function): Likewise.
	* c-tree.h (C_DECL_ISNT_PROTOTYPED): Likewise.
	* config/ia64/ia64.h (INIT_CUMULATIVE_ARGS): Likewise.
	* config/mep/mep.c (mep_validate_interrupt): Likewise.
	* config/pa/pa.h (INIT_CUMULATIVE_ARGS): Likewise.
	* config/rs6000/rs6000.c (init_cumulative_args): Likewise.
	* config/sh/sh.c (sh_init_cumulative_args): Likewise.
	* config/sparc/sparc.c (init_cumulative_args): Likewise.
	* dwarf2out.c (add_prototyped_attribute): Likewise.
	(gen_subprogram_die): Likewise.
	* ipa-type-escape.c (check_function_parameter_and_return_types):
	Likewise.
	(check_call): Likewise.
	* tree-ssa.c (useless_type_conversion_p): Likewise.

gcc/ada/
	* gcc-interface/utils.c (handle_nonnull_attribute): Use prototype_p.
	(handle_sentinel_attribute): Likewise.

gcc/c-family/
	* c-common.c (handle_nonnull_attribute, handle_sentinel_attribute):
	Use prototype_p.

gcc/cp/
	* decl.c (decls_match, duplicate_decls): Use prototype_p.
	* pt.c (push_template_decl_real): Likewise.

gcc/lto/
	* lto-lang.c (handle_nonnull_attribute, handle_sentinel_attribute):
	Use prototype_p.

gcc/objc/
	* objc-act.c (next_sjlj_build_enter_and_setjmp): Use prototype_p.

From-SVN: r168181
This commit is contained in:
Nathan Froyd 2010-12-22 19:45:58 +00:00 committed by Nathan Froyd
parent 7d127f5921
commit f4da8dce7a
24 changed files with 82 additions and 40 deletions

View file

@ -1,3 +1,24 @@
2010-12-22 Nathan Froyd <froydnj@codesourcery.com>
* c-aux-info.c (gen_formal_list_for_type): Use prototype_p.
* c-decl.c (diagnose_arglist_conflict): Likewise.
(diagnose_mismatched_decls, merge_decls): Likewise.
(c_builtin_function, c_builtin_function_ext_scope): Likewise.
(start_decl, start_function): Likewise.
* c-tree.h (C_DECL_ISNT_PROTOTYPED): Likewise.
* config/ia64/ia64.h (INIT_CUMULATIVE_ARGS): Likewise.
* config/mep/mep.c (mep_validate_interrupt): Likewise.
* config/pa/pa.h (INIT_CUMULATIVE_ARGS): Likewise.
* config/rs6000/rs6000.c (init_cumulative_args): Likewise.
* config/sh/sh.c (sh_init_cumulative_args): Likewise.
* config/sparc/sparc.c (init_cumulative_args): Likewise.
* dwarf2out.c (add_prototyped_attribute): Likewise.
(gen_subprogram_die): Likewise.
* ipa-type-escape.c (check_function_parameter_and_return_types):
Likewise.
(check_call): Likewise.
* tree-ssa.c (useless_type_conversion_p): Likewise.
2010-12-22 Ulrich Weigand <Ulrich.Weigand@de.ibm.com> 2010-12-22 Ulrich Weigand <Ulrich.Weigand@de.ibm.com>
* config/spu/spu.md ("mov<mode>"): Use nonimmediate_operand * config/spu/spu.md ("mov<mode>"): Use nonimmediate_operand

View file

@ -1,3 +1,8 @@
2010-12-22 Nathan Froyd <froydnj@codesourcery.com>
* gcc-interface/utils.c (handle_nonnull_attribute): Use prototype_p.
(handle_sentinel_attribute): Likewise.
2010-12-20 Ralf Wildenhues <Ralf.Wildenhues@gmx.de> 2010-12-20 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
PR bootstrap/47027 PR bootstrap/47027

View file

@ -5065,7 +5065,7 @@ handle_nonnull_attribute (tree *node, tree ARG_UNUSED (name),
will have the correct types when we actually check them later. */ will have the correct types when we actually check them later. */
if (!args) if (!args)
{ {
if (!TYPE_ARG_TYPES (type)) if (!prototype_p (type))
{ {
error ("nonnull attribute without arguments on a non-prototype"); error ("nonnull attribute without arguments on a non-prototype");
*no_add_attrs = true; *no_add_attrs = true;
@ -5130,7 +5130,7 @@ handle_sentinel_attribute (tree *node, tree name, tree args,
{ {
tree params = TYPE_ARG_TYPES (*node); tree params = TYPE_ARG_TYPES (*node);
if (!params) if (!prototype_p (*node))
{ {
warning (OPT_Wattributes, warning (OPT_Wattributes,
"%qs attribute requires prototypes with named arguments", "%qs attribute requires prototypes with named arguments",

View file

@ -163,7 +163,7 @@ gen_formal_list_for_type (tree fntype, formals_style style)
if (!*formal_list) if (!*formal_list)
{ {
if (TYPE_ARG_TYPES (fntype)) if (prototype_p (fntype))
/* assert (TREE_VALUE (TYPE_ARG_TYPES (fntype)) == void_type_node); */ /* assert (TREE_VALUE (TYPE_ARG_TYPES (fntype)) == void_type_node); */
formal_list = "void"; formal_list = "void";
else else

View file

@ -1501,9 +1501,8 @@ diagnose_arglist_conflict (tree newdecl, tree olddecl,
if (TREE_CODE (olddecl) != FUNCTION_DECL if (TREE_CODE (olddecl) != FUNCTION_DECL
|| !comptypes (TREE_TYPE (oldtype), TREE_TYPE (newtype)) || !comptypes (TREE_TYPE (oldtype), TREE_TYPE (newtype))
|| !((TYPE_ARG_TYPES (oldtype) == 0 && DECL_INITIAL (olddecl) == 0) || !((!prototype_p (oldtype) && DECL_INITIAL (olddecl) == 0)
|| || (!prototype_p (newtype) && DECL_INITIAL (newdecl) == 0)))
(TYPE_ARG_TYPES (newtype) == 0 && DECL_INITIAL (newdecl) == 0)))
return; return;
t = TYPE_ARG_TYPES (oldtype); t = TYPE_ARG_TYPES (oldtype);
@ -1833,7 +1832,7 @@ diagnose_mismatched_decls (tree newdecl, tree olddecl,
&& !C_DECL_DECLARED_BUILTIN (olddecl) && !C_DECL_DECLARED_BUILTIN (olddecl)
&& (!TREE_PUBLIC (newdecl) && (!TREE_PUBLIC (newdecl)
|| (DECL_INITIAL (newdecl) || (DECL_INITIAL (newdecl)
&& !TYPE_ARG_TYPES (TREE_TYPE (newdecl))))) && !prototype_p (TREE_TYPE (newdecl)))))
{ {
warning (OPT_Wshadow, "declaration of %q+D shadows " warning (OPT_Wshadow, "declaration of %q+D shadows "
"a built-in function", newdecl); "a built-in function", newdecl);
@ -1870,7 +1869,7 @@ diagnose_mismatched_decls (tree newdecl, tree olddecl,
/* If we have a prototype after an old-style function definition, /* If we have a prototype after an old-style function definition,
the argument types must be checked specially. */ the argument types must be checked specially. */
else if (DECL_INITIAL (olddecl) else if (DECL_INITIAL (olddecl)
&& !TYPE_ARG_TYPES (oldtype) && TYPE_ARG_TYPES (newtype) && !prototype_p (oldtype) && prototype_p (newtype)
&& TYPE_ACTUAL_ARG_TYPES (oldtype) && TYPE_ACTUAL_ARG_TYPES (oldtype)
&& !validate_proto_after_old_defn (newdecl, newtype, oldtype)) && !validate_proto_after_old_defn (newdecl, newtype, oldtype))
{ {
@ -2139,9 +2138,9 @@ merge_decls (tree newdecl, tree olddecl, tree newtype, tree oldtype)
bool new_is_definition = (TREE_CODE (newdecl) == FUNCTION_DECL bool new_is_definition = (TREE_CODE (newdecl) == FUNCTION_DECL
&& DECL_INITIAL (newdecl) != 0); && DECL_INITIAL (newdecl) != 0);
bool new_is_prototype = (TREE_CODE (newdecl) == FUNCTION_DECL bool new_is_prototype = (TREE_CODE (newdecl) == FUNCTION_DECL
&& TYPE_ARG_TYPES (TREE_TYPE (newdecl)) != 0); && prototype_p (TREE_TYPE (newdecl)));
bool old_is_prototype = (TREE_CODE (olddecl) == FUNCTION_DECL bool old_is_prototype = (TREE_CODE (olddecl) == FUNCTION_DECL
&& TYPE_ARG_TYPES (TREE_TYPE (olddecl)) != 0); && prototype_p (TREE_TYPE (olddecl)));
bool extern_changed = false; bool extern_changed = false;
/* For real parm decl following a forward decl, rechain the old decl /* For real parm decl following a forward decl, rechain the old decl
@ -3539,7 +3538,7 @@ c_builtin_function (tree decl)
tree id = DECL_NAME (decl); tree id = DECL_NAME (decl);
const char *name = IDENTIFIER_POINTER (id); const char *name = IDENTIFIER_POINTER (id);
C_DECL_BUILTIN_PROTOTYPE (decl) = (TYPE_ARG_TYPES (type) != 0); C_DECL_BUILTIN_PROTOTYPE (decl) = prototype_p (type);
/* Should never be called on a symbol with a preexisting meaning. */ /* Should never be called on a symbol with a preexisting meaning. */
gcc_assert (!I_SYMBOL_BINDING (id)); gcc_assert (!I_SYMBOL_BINDING (id));
@ -3565,7 +3564,7 @@ c_builtin_function_ext_scope (tree decl)
tree id = DECL_NAME (decl); tree id = DECL_NAME (decl);
const char *name = IDENTIFIER_POINTER (id); const char *name = IDENTIFIER_POINTER (id);
C_DECL_BUILTIN_PROTOTYPE (decl) = (TYPE_ARG_TYPES (type) != 0); C_DECL_BUILTIN_PROTOTYPE (decl) = prototype_p (type);
/* Should never be called on a symbol with a preexisting meaning. */ /* Should never be called on a symbol with a preexisting meaning. */
gcc_assert (!I_SYMBOL_BINDING (id)); gcc_assert (!I_SYMBOL_BINDING (id));
@ -4001,7 +4000,7 @@ start_decl (struct c_declarator *declarator, struct c_declspecs *declspecs,
prototypes file (if requested). */ prototypes file (if requested). */
if (TREE_CODE (decl) == FUNCTION_DECL) if (TREE_CODE (decl) == FUNCTION_DECL)
gen_aux_info_record (decl, 0, 0, TYPE_ARG_TYPES (TREE_TYPE (decl)) != 0); gen_aux_info_record (decl, 0, 0, prototype_p (TREE_TYPE (decl)));
/* ANSI specifies that a tentative definition which is not merged with /* ANSI specifies that a tentative definition which is not merged with
a non-tentative definition behaves exactly like a definition with an a non-tentative definition behaves exactly like a definition with an
@ -7625,7 +7624,7 @@ start_function (struct c_declspecs *declspecs, struct c_declarator *declarator,
current_function_prototype_locus = UNKNOWN_LOCATION; current_function_prototype_locus = UNKNOWN_LOCATION;
current_function_prototype_built_in = false; current_function_prototype_built_in = false;
current_function_prototype_arg_types = NULL_TREE; current_function_prototype_arg_types = NULL_TREE;
if (TYPE_ARG_TYPES (TREE_TYPE (decl1)) == 0) if (!prototype_p (TREE_TYPE (decl1)))
{ {
if (old_decl != 0 && TREE_CODE (TREE_TYPE (old_decl)) == FUNCTION_TYPE if (old_decl != 0 && TREE_CODE (TREE_TYPE (old_decl)) == FUNCTION_TYPE
&& comptypes (TREE_TYPE (TREE_TYPE (decl1)), && comptypes (TREE_TYPE (TREE_TYPE (decl1)),
@ -7674,7 +7673,7 @@ start_function (struct c_declspecs *declspecs, struct c_declarator *declarator,
/* Optionally warn of old-fashioned def with no previous prototype. */ /* Optionally warn of old-fashioned def with no previous prototype. */
if (warn_strict_prototypes if (warn_strict_prototypes
&& old_decl != error_mark_node && old_decl != error_mark_node
&& TYPE_ARG_TYPES (TREE_TYPE (decl1)) == 0 && !prototype_p (TREE_TYPE (decl1))
&& C_DECL_ISNT_PROTOTYPE (old_decl)) && C_DECL_ISNT_PROTOTYPE (old_decl))
warning_at (loc, OPT_Wstrict_prototypes, warning_at (loc, OPT_Wstrict_prototypes,
"function declaration isn%'t a prototype"); "function declaration isn%'t a prototype");
@ -7692,7 +7691,7 @@ start_function (struct c_declspecs *declspecs, struct c_declarator *declarator,
&& old_decl != 0 && old_decl != 0
&& old_decl != error_mark_node && old_decl != error_mark_node
&& TREE_USED (old_decl) && TREE_USED (old_decl)
&& TYPE_ARG_TYPES (TREE_TYPE (old_decl)) == 0) && !prototype_p (TREE_TYPE (old_decl)))
warning_at (loc, OPT_Wmissing_prototypes, warning_at (loc, OPT_Wmissing_prototypes,
"%qD was used with no prototype before its definition", decl1); "%qD was used with no prototype before its definition", decl1);
/* Optionally warn of any global def with no previous declaration. */ /* Optionally warn of any global def with no previous declaration. */

View file

@ -1,3 +1,8 @@
2010-12-22 Nathan Froyd <froydnj@codesourcery.com>
* c-common.c (handle_nonnull_attribute, handle_sentinel_attribute):
Use prototype_p.
2010-12-18 Nicola Pero <nicola.pero@meta-innovation.com> 2010-12-18 Nicola Pero <nicola.pero@meta-innovation.com>
* c-objc.h (objc_maybe_warn_exceptions): New. * c-objc.h (objc_maybe_warn_exceptions): New.

View file

@ -7348,7 +7348,7 @@ handle_nonnull_attribute (tree *node, tree ARG_UNUSED (name),
will have the correct types when we actually check them later. */ will have the correct types when we actually check them later. */
if (!args) if (!args)
{ {
if (!TYPE_ARG_TYPES (type)) if (!prototype_p (type))
{ {
error ("nonnull attribute without arguments on a non-prototype"); error ("nonnull attribute without arguments on a non-prototype");
*no_add_attrs = true; *no_add_attrs = true;
@ -7631,7 +7631,7 @@ handle_sentinel_attribute (tree *node, tree name, tree args,
{ {
tree params = TYPE_ARG_TYPES (*node); tree params = TYPE_ARG_TYPES (*node);
if (!params) if (!prototype_p (*node))
{ {
warning (OPT_Wattributes, warning (OPT_Wattributes,
"%qE attribute requires prototypes with named arguments", name); "%qE attribute requires prototypes with named arguments", name);

View file

@ -98,7 +98,7 @@ along with GCC; see the file COPYING3. If not see
(but this is presently difficult because some of them need FILE*). */ (but this is presently difficult because some of them need FILE*). */
#define C_DECL_ISNT_PROTOTYPE(EXP) \ #define C_DECL_ISNT_PROTOTYPE(EXP) \
(EXP == 0 \ (EXP == 0 \
|| (TYPE_ARG_TYPES (TREE_TYPE (EXP)) == 0 \ || (!prototype_p (TREE_TYPE (EXP)) \
&& !DECL_BUILT_IN (EXP))) && !DECL_BUILT_IN (EXP)))
/* For FUNCTION_TYPE, a hidden list of types of arguments. The same as /* For FUNCTION_TYPE, a hidden list of types of arguments. The same as

View file

@ -1047,7 +1047,7 @@ do { \
(CUM).words = 0; \ (CUM).words = 0; \
(CUM).int_regs = 0; \ (CUM).int_regs = 0; \
(CUM).fp_regs = 0; \ (CUM).fp_regs = 0; \
(CUM).prototype = ((FNTYPE) && TYPE_ARG_TYPES (FNTYPE)) || (LIBNAME); \ (CUM).prototype = ((FNTYPE) && prototype_p (FNTYPE)) || (LIBNAME); \
(CUM).atypes[0] = (CUM).atypes[1] = (CUM).atypes[2] = I64; \ (CUM).atypes[0] = (CUM).atypes[1] = (CUM).atypes[2] = I64; \
(CUM).atypes[3] = (CUM).atypes[4] = (CUM).atypes[5] = I64; \ (CUM).atypes[3] = (CUM).atypes[4] = (CUM).atypes[5] = I64; \
(CUM).atypes[6] = (CUM).atypes[7] = I64; \ (CUM).atypes[6] = (CUM).atypes[7] = I64; \

View file

@ -4001,7 +4001,7 @@ mep_validate_interrupt (tree *node, tree name, tree args ATTRIBUTE_UNUSED,
if (TREE_TYPE (function_type) != void_type_node) if (TREE_TYPE (function_type) != void_type_node)
error ("interrupt function must have return type of void"); error ("interrupt function must have return type of void");
if (TYPE_ARG_TYPES (function_type) if (prototype_p (function_type)
&& (TREE_VALUE (TYPE_ARG_TYPES (function_type)) != void_type_node && (TREE_VALUE (TYPE_ARG_TYPES (function_type)) != void_type_node
|| TREE_CHAIN (TYPE_ARG_TYPES (function_type)) != NULL_TREE)) || TREE_CHAIN (TYPE_ARG_TYPES (function_type)) != NULL_TREE))
error ("interrupt function must have no arguments"); error ("interrupt function must have no arguments");

View file

@ -599,7 +599,7 @@ struct hppa_args {int words, nargs_prototype, incoming, indirect; };
(CUM).words = 0, \ (CUM).words = 0, \
(CUM).incoming = 0, \ (CUM).incoming = 0, \
(CUM).indirect = (FNTYPE) && !(FNDECL), \ (CUM).indirect = (FNTYPE) && !(FNDECL), \
(CUM).nargs_prototype = (FNTYPE && TYPE_ARG_TYPES (FNTYPE) \ (CUM).nargs_prototype = (FNTYPE && prototype_p (FNTYPE) \
? (list_length (TYPE_ARG_TYPES (FNTYPE)) - 1 \ ? (list_length (TYPE_ARG_TYPES (FNTYPE)) - 1 \
+ (TYPE_MODE (TREE_TYPE (FNTYPE)) == BLKmode \ + (TYPE_MODE (TREE_TYPE (FNTYPE)) == BLKmode \
|| pa_return_in_memory (TREE_TYPE (FNTYPE), 0))) \ || pa_return_in_memory (TREE_TYPE (FNTYPE), 0))) \

View file

@ -7874,7 +7874,7 @@ init_cumulative_args (CUMULATIVE_ARGS *cum, tree fntype,
cum->words = 0; cum->words = 0;
cum->fregno = FP_ARG_MIN_REG; cum->fregno = FP_ARG_MIN_REG;
cum->vregno = ALTIVEC_ARG_MIN_REG; cum->vregno = ALTIVEC_ARG_MIN_REG;
cum->prototype = (fntype && TYPE_ARG_TYPES (fntype)); cum->prototype = (fntype && prototype_p (fntype));
cum->call_cookie = ((DEFAULT_ABI == ABI_V4 && libcall) cum->call_cookie = ((DEFAULT_ABI == ABI_V4 && libcall)
? CALL_LIBCALL : CALL_NORMAL); ? CALL_LIBCALL : CALL_NORMAL);
cum->sysv_gregno = GP_ARG_MIN_REG; cum->sysv_gregno = GP_ARG_MIN_REG;

View file

@ -12119,7 +12119,7 @@ sh_init_cumulative_args (CUMULATIVE_ARGS * pcum,
{ {
pcum->force_mem = ((TARGET_HITACHI || pcum->renesas_abi) pcum->force_mem = ((TARGET_HITACHI || pcum->renesas_abi)
&& aggregate_value_p (TREE_TYPE (fntype), fndecl)); && aggregate_value_p (TREE_TYPE (fntype), fndecl));
pcum->prototype_p = TYPE_ARG_TYPES (fntype) ? TRUE : FALSE; pcum->prototype_p = prototype_p (fntype);
pcum->arg_count [(int) SH_ARG_INT] pcum->arg_count [(int) SH_ARG_INT]
= TARGET_SH5 && aggregate_value_p (TREE_TYPE (fntype), fndecl); = TARGET_SH5 && aggregate_value_p (TREE_TYPE (fntype), fndecl);

View file

@ -5017,7 +5017,7 @@ init_cumulative_args (struct sparc_args *cum, tree fntype,
tree fndecl ATTRIBUTE_UNUSED) tree fndecl ATTRIBUTE_UNUSED)
{ {
cum->words = 0; cum->words = 0;
cum->prototype_p = fntype && TYPE_ARG_TYPES (fntype); cum->prototype_p = fntype && prototype_p (fntype);
cum->libcall_p = fntype == 0; cum->libcall_p = fntype == 0;
} }

View file

@ -1,3 +1,8 @@
2010-12-22 Nathan Froyd <froydnj@codesourcery.com>
* decl.c (decls_match, duplicate_decls): Use prototype_p.
* pt.c (push_template_decl_real): Likewise.
2010-12-22 Jason Merrill <jason@redhat.com> 2010-12-22 Jason Merrill <jason@redhat.com>
PR c++/47003 PR c++/47003

View file

@ -983,7 +983,7 @@ decls_match (tree newdecl, tree olddecl)
if (same_type_p (TREE_TYPE (f1), TREE_TYPE (f2))) if (same_type_p (TREE_TYPE (f1), TREE_TYPE (f2)))
{ {
if (p2 == NULL_TREE && DECL_EXTERN_C_P (olddecl) if (!prototype_p (f2) && DECL_EXTERN_C_P (olddecl)
&& (DECL_BUILT_IN (olddecl) && (DECL_BUILT_IN (olddecl)
#ifndef NO_IMPLICIT_EXTERN_C #ifndef NO_IMPLICIT_EXTERN_C
|| (DECL_IN_SYSTEM_HEADER (newdecl) && !DECL_CLASS_SCOPE_P (newdecl)) || (DECL_IN_SYSTEM_HEADER (newdecl) && !DECL_CLASS_SCOPE_P (newdecl))
@ -996,7 +996,7 @@ decls_match (tree newdecl, tree olddecl)
TREE_TYPE (newdecl) = TREE_TYPE (olddecl); TREE_TYPE (newdecl) = TREE_TYPE (olddecl);
} }
#ifndef NO_IMPLICIT_EXTERN_C #ifndef NO_IMPLICIT_EXTERN_C
else if (p1 == NULL_TREE else if (!prototype_p (f1)
&& (DECL_EXTERN_C_P (olddecl) && (DECL_EXTERN_C_P (olddecl)
&& DECL_IN_SYSTEM_HEADER (olddecl) && DECL_IN_SYSTEM_HEADER (olddecl)
&& !DECL_CLASS_SCOPE_P (olddecl)) && !DECL_CLASS_SCOPE_P (olddecl))
@ -1536,8 +1536,8 @@ duplicate_decls (tree newdecl, tree olddecl, bool newdecl_is_friend)
} }
else if (TREE_CODE (olddecl) == FUNCTION_DECL else if (TREE_CODE (olddecl) == FUNCTION_DECL
&& DECL_INITIAL (olddecl) != NULL_TREE && DECL_INITIAL (olddecl) != NULL_TREE
&& TYPE_ARG_TYPES (TREE_TYPE (olddecl)) == NULL_TREE && !prototype_p (TREE_TYPE (olddecl))
&& TYPE_ARG_TYPES (TREE_TYPE (newdecl)) != NULL_TREE) && prototype_p (TREE_TYPE (newdecl)))
{ {
/* Prototype decl follows defn w/o prototype. */ /* Prototype decl follows defn w/o prototype. */
warning_at (input_location, 0, "prototype for %q+#D", newdecl); warning_at (input_location, 0, "prototype for %q+#D", newdecl);

View file

@ -4737,7 +4737,7 @@ push_template_decl_real (tree decl, bool is_friend)
return error_mark_node; return error_mark_node;
} }
if (NEW_DELETE_OPNAME_P (DECL_NAME (decl)) if (NEW_DELETE_OPNAME_P (DECL_NAME (decl))
&& (!TYPE_ARG_TYPES (TREE_TYPE (decl)) && (!prototype_p (TREE_TYPE (decl))
|| TYPE_ARG_TYPES (TREE_TYPE (decl)) == void_list_node || TYPE_ARG_TYPES (TREE_TYPE (decl)) == void_list_node
|| !TREE_CHAIN (TYPE_ARG_TYPES (TREE_TYPE (decl))) || !TREE_CHAIN (TYPE_ARG_TYPES (TREE_TYPE (decl)))
|| (TREE_CHAIN (TYPE_ARG_TYPES ((TREE_TYPE (decl)))) || (TREE_CHAIN (TYPE_ARG_TYPES ((TREE_TYPE (decl))))

View file

@ -17651,7 +17651,7 @@ static inline void
add_prototyped_attribute (dw_die_ref die, tree func_type) add_prototyped_attribute (dw_die_ref die, tree func_type)
{ {
if (get_AT_unsigned (comp_unit_die (), DW_AT_language) == DW_LANG_C89 if (get_AT_unsigned (comp_unit_die (), DW_AT_language) == DW_LANG_C89
&& TYPE_ARG_TYPES (func_type) != NULL) && prototype_p (func_type))
add_AT_flag (die, DW_AT_prototyped, 1); add_AT_flag (die, DW_AT_prototyped, 1);
} }
@ -18900,7 +18900,6 @@ gen_subprogram_die (tree decl, dw_die_ref context_die)
char label_id[MAX_ARTIFICIAL_LABEL_BYTES]; char label_id[MAX_ARTIFICIAL_LABEL_BYTES];
tree origin = decl_ultimate_origin (decl); tree origin = decl_ultimate_origin (decl);
dw_die_ref subr_die; dw_die_ref subr_die;
tree fn_arg_types;
tree outer_scope; tree outer_scope;
dw_die_ref old_die = lookup_decl_die (decl); dw_die_ref old_die = lookup_decl_die (decl);
int declaration = (current_function_decl != decl int declaration = (current_function_decl != decl
@ -19238,8 +19237,7 @@ gen_subprogram_die (tree decl, dw_die_ref context_die)
void_type_node 2) an unprototyped function declaration (not a void_type_node 2) an unprototyped function declaration (not a
definition). This just means that we have no info about the definition). This just means that we have no info about the
parameters at all. */ parameters at all. */
fn_arg_types = TYPE_ARG_TYPES (TREE_TYPE (decl)); if (prototype_p (TREE_TYPE (decl)))
if (fn_arg_types != NULL)
{ {
/* This is the prototyped case, check for.... */ /* This is the prototyped case, check for.... */
if (stdarg_p (TREE_TYPE (decl))) if (stdarg_p (TREE_TYPE (decl)))

View file

@ -1025,7 +1025,7 @@ check_function_parameter_and_return_types (tree fn, bool escapes)
{ {
tree arg; tree arg;
if (TYPE_ARG_TYPES (TREE_TYPE (fn))) if (prototype_p (TREE_TYPE (fn)))
{ {
for (arg = TYPE_ARG_TYPES (TREE_TYPE (fn)); for (arg = TYPE_ARG_TYPES (TREE_TYPE (fn));
arg && TREE_VALUE (arg) != void_type_node; arg && TREE_VALUE (arg) != void_type_node;
@ -1333,7 +1333,7 @@ check_call (gimple call)
/* Check that there are no implicit casts in the passing of /* Check that there are no implicit casts in the passing of
parameters. */ parameters. */
if (TYPE_ARG_TYPES (TREE_TYPE (callee_t))) if (prototype_p (TREE_TYPE (callee_t)))
{ {
for (arg_type = TYPE_ARG_TYPES (TREE_TYPE (callee_t)), i = 0; for (arg_type = TYPE_ARG_TYPES (TREE_TYPE (callee_t)), i = 0;
arg_type && TREE_VALUE (arg_type) != void_type_node arg_type && TREE_VALUE (arg_type) != void_type_node

View file

@ -1,3 +1,8 @@
2010-12-22 Nathan Froyd <froydnj@codesourcery.com>
* lto-lang.c (handle_nonnull_attribute, handle_sentinel_attribute):
Use prototype_p.
2010-12-06 Richard Guenther <rguenther@suse.de> 2010-12-06 Richard Guenther <rguenther@suse.de>
PR lto/46796 PR lto/46796

View file

@ -313,7 +313,7 @@ handle_nonnull_attribute (tree *node, tree ARG_UNUSED (name),
will have the correct types when we actually check them later. */ will have the correct types when we actually check them later. */
if (!args) if (!args)
{ {
gcc_assert (TYPE_ARG_TYPES (type)); gcc_assert (prototype_p (type));
return NULL_TREE; return NULL_TREE;
} }

View file

@ -1,3 +1,7 @@
2010-12-22 Nathan Froyd <froydnj@codesourcery.com>
* objc-act.c (next_sjlj_build_enter_and_setjmp): Use prototype_p.
2010-12-18 Nicola Pero <nicola.pero@meta-innovation.com> 2010-12-18 Nicola Pero <nicola.pero@meta-innovation.com>
* objc-act.c (objc_init): Call using_eh_for_cleanups. * objc-act.c (objc_init): Call using_eh_for_cleanups.

View file

@ -5126,7 +5126,7 @@ next_sjlj_build_enter_and_setjmp (void)
t = build_fold_addr_expr_loc (input_location, t); t = build_fold_addr_expr_loc (input_location, t);
#ifdef OBJCPLUS #ifdef OBJCPLUS
/* Convert _setjmp argument to type that is expected. */ /* Convert _setjmp argument to type that is expected. */
if (TYPE_ARG_TYPES (TREE_TYPE (objc_setjmp_decl))) if (prototype_p (TREE_TYPE (objc_setjmp_decl)))
t = convert (TREE_VALUE (TYPE_ARG_TYPES (TREE_TYPE (objc_setjmp_decl))), t); t = convert (TREE_VALUE (TYPE_ARG_TYPES (TREE_TYPE (objc_setjmp_decl))), t);
else else
t = convert (ptr_type_node, t); t = convert (ptr_type_node, t);

View file

@ -1241,7 +1241,7 @@ useless_type_conversion_p (tree outer_type, tree inner_type)
|| TREE_CODE (TREE_TYPE (outer_type)) == METHOD_TYPE) || TREE_CODE (TREE_TYPE (outer_type)) == METHOD_TYPE)
&& (TREE_CODE (TREE_TYPE (outer_type)) && (TREE_CODE (TREE_TYPE (outer_type))
== TREE_CODE (TREE_TYPE (inner_type))) == TREE_CODE (TREE_TYPE (inner_type)))
&& !TYPE_ARG_TYPES (TREE_TYPE (outer_type)) && !prototype_p (TREE_TYPE (outer_type))
&& useless_type_conversion_p (TREE_TYPE (TREE_TYPE (outer_type)), && useless_type_conversion_p (TREE_TYPE (TREE_TYPE (outer_type)),
TREE_TYPE (TREE_TYPE (inner_type))))) TREE_TYPE (TREE_TYPE (inner_type)))))
return true; return true;
@ -1407,7 +1407,7 @@ useless_type_conversion_p (tree outer_type, tree inner_type)
return false; return false;
/* A conversion to an unprototyped argument list is ok. */ /* A conversion to an unprototyped argument list is ok. */
if (!TYPE_ARG_TYPES (outer_type)) if (!prototype_p (outer_type))
return true; return true;
/* If the unqualified argument types are compatible the conversion /* If the unqualified argument types are compatible the conversion