aboutsummaryrefslogtreecommitdiff
path: root/gcc/c-decl.c
diff options
context:
space:
mode:
authorNathan Froyd <froydnj@codesourcery.com>2010-12-22 19:45:58 +0000
committerNathan Froyd <froydnj@gcc.gnu.org>2010-12-22 19:45:58 +0000
commitf4da8dce7a9023cf147d1a7537c0b75fe41fecbf (patch)
tree0e435cd3933ac64da92933bc369a098bc84b208d /gcc/c-decl.c
parent7d127f5921df15abb3d4bdbc3f71f4784c641207 (diff)
downloadgcc-f4da8dce7a9023cf147d1a7537c0b75fe41fecbf.zip
gcc-f4da8dce7a9023cf147d1a7537c0b75fe41fecbf.tar.gz
gcc-f4da8dce7a9023cf147d1a7537c0b75fe41fecbf.tar.bz2
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
Diffstat (limited to 'gcc/c-decl.c')
-rw-r--r--gcc/c-decl.c25
1 files changed, 12 insertions, 13 deletions
diff --git a/gcc/c-decl.c b/gcc/c-decl.c
index f9672a0..40fccbe 100644
--- a/gcc/c-decl.c
+++ b/gcc/c-decl.c
@@ -1501,9 +1501,8 @@ diagnose_arglist_conflict (tree newdecl, tree olddecl,
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);
@@ -1833,7 +1832,7 @@ diagnose_mismatched_decls (tree newdecl, tree olddecl,
&& !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);
@@ -1870,7 +1869,7 @@ diagnose_mismatched_decls (tree newdecl, tree olddecl,
/* 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))
{
@@ -2139,9 +2138,9 @@ merge_decls (tree newdecl, tree olddecl, tree newtype, tree 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
@@ -3539,7 +3538,7 @@ c_builtin_function (tree 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));
@@ -3565,7 +3564,7 @@ c_builtin_function_ext_scope (tree 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));
@@ -4001,7 +4000,7 @@ start_decl (struct c_declarator *declarator, struct c_declspecs *declspecs,
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
@@ -7625,7 +7624,7 @@ start_function (struct c_declspecs *declspecs, struct c_declarator *declarator,
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)),
@@ -7674,7 +7673,7 @@ start_function (struct c_declspecs *declspecs, struct c_declarator *declarator,
/* 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");
@@ -7692,7 +7691,7 @@ start_function (struct c_declspecs *declspecs, struct c_declarator *declarator,
&& 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. */