* 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.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@168181
138bc75d-0d04-0410-961f-
82ee72b054a4
+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>
* config/spu/spu.md ("mov<mode>"): Use nonimmediate_operand
+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>
PR bootstrap/47027
will have the correct types when we actually check them later. */
if (!args)
{
- if (!TYPE_ARG_TYPES (type))
+ if (!prototype_p (type))
{
error ("nonnull attribute without arguments on a non-prototype");
*no_add_attrs = true;
{
tree params = TYPE_ARG_TYPES (*node);
- if (!params)
+ if (!prototype_p (*node))
{
warning (OPT_Wattributes,
"%qs attribute requires prototypes with named arguments",
if (!*formal_list)
{
- if (TYPE_ARG_TYPES (fntype))
+ if (prototype_p (fntype))
/* assert (TREE_VALUE (TYPE_ARG_TYPES (fntype)) == void_type_node); */
formal_list = "void";
else
if (TREE_CODE (olddecl) != FUNCTION_DECL
|| !comptypes (TREE_TYPE (oldtype), TREE_TYPE (newtype))
- || !((TYPE_ARG_TYPES (oldtype) == 0 && DECL_INITIAL (olddecl) == 0)
- ||
- (TYPE_ARG_TYPES (newtype) == 0 && DECL_INITIAL (newdecl) == 0)))
+ || !((!prototype_p (oldtype) && DECL_INITIAL (olddecl) == 0)
+ || (!prototype_p (newtype) && DECL_INITIAL (newdecl) == 0)))
return;
t = TYPE_ARG_TYPES (oldtype);
&& !C_DECL_DECLARED_BUILTIN (olddecl)
&& (!TREE_PUBLIC (newdecl)
|| (DECL_INITIAL (newdecl)
- && !TYPE_ARG_TYPES (TREE_TYPE (newdecl)))))
+ && !prototype_p (TREE_TYPE (newdecl)))))
{
warning (OPT_Wshadow, "declaration of %q+D shadows "
"a built-in function", newdecl);
/* If we have a prototype after an old-style function definition,
the argument types must be checked specially. */
else if (DECL_INITIAL (olddecl)
- && !TYPE_ARG_TYPES (oldtype) && TYPE_ARG_TYPES (newtype)
+ && !prototype_p (oldtype) && prototype_p (newtype)
&& TYPE_ACTUAL_ARG_TYPES (oldtype)
&& !validate_proto_after_old_defn (newdecl, newtype, oldtype))
{
bool new_is_definition = (TREE_CODE (newdecl) == FUNCTION_DECL
&& DECL_INITIAL (newdecl) != 0);
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
- && TYPE_ARG_TYPES (TREE_TYPE (olddecl)) != 0);
+ && prototype_p (TREE_TYPE (olddecl)));
bool extern_changed = false;
/* For real parm decl following a forward decl, rechain the old decl
tree id = DECL_NAME (decl);
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. */
gcc_assert (!I_SYMBOL_BINDING (id));
tree id = DECL_NAME (decl);
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. */
gcc_assert (!I_SYMBOL_BINDING (id));
prototypes file (if requested). */
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
a non-tentative definition behaves exactly like a definition with an
current_function_prototype_locus = UNKNOWN_LOCATION;
current_function_prototype_built_in = false;
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
&& comptypes (TREE_TYPE (TREE_TYPE (decl1)),
/* Optionally warn of old-fashioned def with no previous prototype. */
if (warn_strict_prototypes
&& old_decl != error_mark_node
- && TYPE_ARG_TYPES (TREE_TYPE (decl1)) == 0
+ && !prototype_p (TREE_TYPE (decl1))
&& C_DECL_ISNT_PROTOTYPE (old_decl))
warning_at (loc, OPT_Wstrict_prototypes,
"function declaration isn%'t a prototype");
&& old_decl != 0
&& old_decl != error_mark_node
&& TREE_USED (old_decl)
- && TYPE_ARG_TYPES (TREE_TYPE (old_decl)) == 0)
+ && !prototype_p (TREE_TYPE (old_decl)))
warning_at (loc, OPT_Wmissing_prototypes,
"%qD was used with no prototype before its definition", decl1);
/* Optionally warn of any global def with no previous declaration. */
+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>
* c-objc.h (objc_maybe_warn_exceptions): New.
will have the correct types when we actually check them later. */
if (!args)
{
- if (!TYPE_ARG_TYPES (type))
+ if (!prototype_p (type))
{
error ("nonnull attribute without arguments on a non-prototype");
*no_add_attrs = true;
{
tree params = TYPE_ARG_TYPES (*node);
- if (!params)
+ if (!prototype_p (*node))
{
warning (OPT_Wattributes,
"%qE attribute requires prototypes with named arguments", name);
(but this is presently difficult because some of them need FILE*). */
#define C_DECL_ISNT_PROTOTYPE(EXP) \
(EXP == 0 \
- || (TYPE_ARG_TYPES (TREE_TYPE (EXP)) == 0 \
+ || (!prototype_p (TREE_TYPE (EXP)) \
&& !DECL_BUILT_IN (EXP)))
/* For FUNCTION_TYPE, a hidden list of types of arguments. The same as
(CUM).words = 0; \
(CUM).int_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[3] = (CUM).atypes[4] = (CUM).atypes[5] = I64; \
(CUM).atypes[6] = (CUM).atypes[7] = I64; \
if (TREE_TYPE (function_type) != void_type_node)
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_CHAIN (TYPE_ARG_TYPES (function_type)) != NULL_TREE))
error ("interrupt function must have no arguments");
(CUM).words = 0, \
(CUM).incoming = 0, \
(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 \
+ (TYPE_MODE (TREE_TYPE (FNTYPE)) == BLKmode \
|| pa_return_in_memory (TREE_TYPE (FNTYPE), 0))) \
cum->words = 0;
cum->fregno = FP_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)
? CALL_LIBCALL : CALL_NORMAL);
cum->sysv_gregno = GP_ARG_MIN_REG;
{
pcum->force_mem = ((TARGET_HITACHI || pcum->renesas_abi)
&& 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]
= TARGET_SH5 && aggregate_value_p (TREE_TYPE (fntype), fndecl);
tree fndecl ATTRIBUTE_UNUSED)
{
cum->words = 0;
- cum->prototype_p = fntype && TYPE_ARG_TYPES (fntype);
+ cum->prototype_p = fntype && prototype_p (fntype);
cum->libcall_p = fntype == 0;
}
+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>
PR c++/47003
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)
#ifndef NO_IMPLICIT_EXTERN_C
|| (DECL_IN_SYSTEM_HEADER (newdecl) && !DECL_CLASS_SCOPE_P (newdecl))
TREE_TYPE (newdecl) = TREE_TYPE (olddecl);
}
#ifndef NO_IMPLICIT_EXTERN_C
- else if (p1 == NULL_TREE
+ else if (!prototype_p (f1)
&& (DECL_EXTERN_C_P (olddecl)
&& DECL_IN_SYSTEM_HEADER (olddecl)
&& !DECL_CLASS_SCOPE_P (olddecl))
}
else if (TREE_CODE (olddecl) == FUNCTION_DECL
&& DECL_INITIAL (olddecl) != NULL_TREE
- && TYPE_ARG_TYPES (TREE_TYPE (olddecl)) == NULL_TREE
- && TYPE_ARG_TYPES (TREE_TYPE (newdecl)) != NULL_TREE)
+ && !prototype_p (TREE_TYPE (olddecl))
+ && prototype_p (TREE_TYPE (newdecl)))
{
/* Prototype decl follows defn w/o prototype. */
warning_at (input_location, 0, "prototype for %q+#D", newdecl);
return error_mark_node;
}
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
|| !TREE_CHAIN (TYPE_ARG_TYPES (TREE_TYPE (decl)))
|| (TREE_CHAIN (TYPE_ARG_TYPES ((TREE_TYPE (decl))))
add_prototyped_attribute (dw_die_ref die, tree func_type)
{
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);
}
char label_id[MAX_ARTIFICIAL_LABEL_BYTES];
tree origin = decl_ultimate_origin (decl);
dw_die_ref subr_die;
- tree fn_arg_types;
tree outer_scope;
dw_die_ref old_die = lookup_decl_die (decl);
int declaration = (current_function_decl != decl
void_type_node 2) an unprototyped function declaration (not a
definition). This just means that we have no info about the
parameters at all. */
- fn_arg_types = TYPE_ARG_TYPES (TREE_TYPE (decl));
- if (fn_arg_types != NULL)
+ if (prototype_p (TREE_TYPE (decl)))
{
/* This is the prototyped case, check for.... */
if (stdarg_p (TREE_TYPE (decl)))
{
tree arg;
- if (TYPE_ARG_TYPES (TREE_TYPE (fn)))
+ if (prototype_p (TREE_TYPE (fn)))
{
for (arg = TYPE_ARG_TYPES (TREE_TYPE (fn));
arg && TREE_VALUE (arg) != void_type_node;
/* Check that there are no implicit casts in the passing of
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;
arg_type && TREE_VALUE (arg_type) != void_type_node
+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>
PR lto/46796
will have the correct types when we actually check them later. */
if (!args)
{
- gcc_assert (TYPE_ARG_TYPES (type));
+ gcc_assert (prototype_p (type));
return NULL_TREE;
}
+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>
* objc-act.c (objc_init): Call using_eh_for_cleanups.
t = build_fold_addr_expr_loc (input_location, t);
#ifdef OBJCPLUS
/* 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);
else
t = convert (ptr_type_node, t);
|| TREE_CODE (TREE_TYPE (outer_type)) == METHOD_TYPE)
&& (TREE_CODE (TREE_TYPE (outer_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)),
TREE_TYPE (TREE_TYPE (inner_type)))))
return true;
return false;
/* A conversion to an unprototyped argument list is ok. */
- if (!TYPE_ARG_TYPES (outer_type))
+ if (!prototype_p (outer_type))
return true;
/* If the unqualified argument types are compatible the conversion