diff options
author | Nathan Froyd <froydnj@codesourcery.com> | 2010-12-22 19:45:58 +0000 |
---|---|---|
committer | Nathan Froyd <froydnj@gcc.gnu.org> | 2010-12-22 19:45:58 +0000 |
commit | f4da8dce7a9023cf147d1a7537c0b75fe41fecbf (patch) | |
tree | 0e435cd3933ac64da92933bc369a098bc84b208d /gcc | |
parent | 7d127f5921df15abb3d4bdbc3f71f4784c641207 (diff) | |
download | gcc-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')
-rw-r--r-- | gcc/ChangeLog | 21 | ||||
-rw-r--r-- | gcc/ada/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/ada/gcc-interface/utils.c | 4 | ||||
-rw-r--r-- | gcc/c-aux-info.c | 2 | ||||
-rw-r--r-- | gcc/c-decl.c | 25 | ||||
-rw-r--r-- | gcc/c-family/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/c-family/c-common.c | 4 | ||||
-rw-r--r-- | gcc/c-tree.h | 2 | ||||
-rw-r--r-- | gcc/config/ia64/ia64.h | 2 | ||||
-rw-r--r-- | gcc/config/mep/mep.c | 2 | ||||
-rw-r--r-- | gcc/config/pa/pa.h | 2 | ||||
-rw-r--r-- | gcc/config/rs6000/rs6000.c | 2 | ||||
-rw-r--r-- | gcc/config/sh/sh.c | 2 | ||||
-rw-r--r-- | gcc/config/sparc/sparc.c | 2 | ||||
-rw-r--r-- | gcc/cp/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/cp/decl.c | 8 | ||||
-rw-r--r-- | gcc/cp/pt.c | 2 | ||||
-rw-r--r-- | gcc/dwarf2out.c | 6 | ||||
-rw-r--r-- | gcc/ipa-type-escape.c | 4 | ||||
-rw-r--r-- | gcc/lto/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/lto/lto-lang.c | 2 | ||||
-rw-r--r-- | gcc/objc/ChangeLog | 4 | ||||
-rw-r--r-- | gcc/objc/objc-act.c | 2 | ||||
-rw-r--r-- | gcc/tree-ssa.c | 4 |
24 files changed, 82 insertions, 40 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 9fb3152..11dea2d 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -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> * config/spu/spu.md ("mov<mode>"): Use nonimmediate_operand diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog index 5aece2c..cbe8cad 100644 --- a/gcc/ada/ChangeLog +++ b/gcc/ada/ChangeLog @@ -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> PR bootstrap/47027 diff --git a/gcc/ada/gcc-interface/utils.c b/gcc/ada/gcc-interface/utils.c index d044957..b92e916 100644 --- a/gcc/ada/gcc-interface/utils.c +++ b/gcc/ada/gcc-interface/utils.c @@ -5065,7 +5065,7 @@ handle_nonnull_attribute (tree *node, tree ARG_UNUSED (name), 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; @@ -5130,7 +5130,7 @@ handle_sentinel_attribute (tree *node, tree name, tree args, { tree params = TYPE_ARG_TYPES (*node); - if (!params) + if (!prototype_p (*node)) { warning (OPT_Wattributes, "%qs attribute requires prototypes with named arguments", diff --git a/gcc/c-aux-info.c b/gcc/c-aux-info.c index 346901f..694f9c1 100644 --- a/gcc/c-aux-info.c +++ b/gcc/c-aux-info.c @@ -163,7 +163,7 @@ gen_formal_list_for_type (tree fntype, formals_style style) 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 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. */ diff --git a/gcc/c-family/ChangeLog b/gcc/c-family/ChangeLog index 4be312d..defca77 100644 --- a/gcc/c-family/ChangeLog +++ b/gcc/c-family/ChangeLog @@ -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> * c-objc.h (objc_maybe_warn_exceptions): New. diff --git a/gcc/c-family/c-common.c b/gcc/c-family/c-common.c index 7b39d55..8eb849a 100644 --- a/gcc/c-family/c-common.c +++ b/gcc/c-family/c-common.c @@ -7348,7 +7348,7 @@ handle_nonnull_attribute (tree *node, tree ARG_UNUSED (name), 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; @@ -7631,7 +7631,7 @@ handle_sentinel_attribute (tree *node, tree name, tree args, { tree params = TYPE_ARG_TYPES (*node); - if (!params) + if (!prototype_p (*node)) { warning (OPT_Wattributes, "%qE attribute requires prototypes with named arguments", name); diff --git a/gcc/c-tree.h b/gcc/c-tree.h index 7bf3bc0..8e88362 100644 --- a/gcc/c-tree.h +++ b/gcc/c-tree.h @@ -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*). */ #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 diff --git a/gcc/config/ia64/ia64.h b/gcc/config/ia64/ia64.h index 32fc9b9..8e6d298 100644 --- a/gcc/config/ia64/ia64.h +++ b/gcc/config/ia64/ia64.h @@ -1047,7 +1047,7 @@ do { \ (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; \ diff --git a/gcc/config/mep/mep.c b/gcc/config/mep/mep.c index 3b11279..913a30a 100644 --- a/gcc/config/mep/mep.c +++ b/gcc/config/mep/mep.c @@ -4001,7 +4001,7 @@ mep_validate_interrupt (tree *node, tree name, tree args ATTRIBUTE_UNUSED, 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"); diff --git a/gcc/config/pa/pa.h b/gcc/config/pa/pa.h index 64c8926..0a0250f 100644 --- a/gcc/config/pa/pa.h +++ b/gcc/config/pa/pa.h @@ -599,7 +599,7 @@ struct hppa_args {int words, nargs_prototype, incoming, indirect; }; (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))) \ diff --git a/gcc/config/rs6000/rs6000.c b/gcc/config/rs6000/rs6000.c index bc27f73..f26e37e 100644 --- a/gcc/config/rs6000/rs6000.c +++ b/gcc/config/rs6000/rs6000.c @@ -7874,7 +7874,7 @@ init_cumulative_args (CUMULATIVE_ARGS *cum, tree fntype, 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; diff --git a/gcc/config/sh/sh.c b/gcc/config/sh/sh.c index 67c7c44..ffe84b1 100644 --- a/gcc/config/sh/sh.c +++ b/gcc/config/sh/sh.c @@ -12119,7 +12119,7 @@ sh_init_cumulative_args (CUMULATIVE_ARGS * pcum, { 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); diff --git a/gcc/config/sparc/sparc.c b/gcc/config/sparc/sparc.c index a066b2a..7df0dfb 100644 --- a/gcc/config/sparc/sparc.c +++ b/gcc/config/sparc/sparc.c @@ -5017,7 +5017,7 @@ init_cumulative_args (struct sparc_args *cum, tree fntype, 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; } diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index cb9cd95..5bdfa43 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -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> PR c++/47003 diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c index f9331bc..f74b0c2 100644 --- a/gcc/cp/decl.c +++ b/gcc/cp/decl.c @@ -983,7 +983,7 @@ decls_match (tree newdecl, tree olddecl) 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)) @@ -996,7 +996,7 @@ decls_match (tree newdecl, tree olddecl) 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)) @@ -1536,8 +1536,8 @@ duplicate_decls (tree newdecl, tree olddecl, bool newdecl_is_friend) } 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); diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c index c76d381..ae6aed0 100644 --- a/gcc/cp/pt.c +++ b/gcc/cp/pt.c @@ -4737,7 +4737,7 @@ push_template_decl_real (tree decl, bool is_friend) 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)))) diff --git a/gcc/dwarf2out.c b/gcc/dwarf2out.c index bc21875..9fe1e9c 100644 --- a/gcc/dwarf2out.c +++ b/gcc/dwarf2out.c @@ -17651,7 +17651,7 @@ static inline void 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); } @@ -18900,7 +18900,6 @@ gen_subprogram_die (tree decl, dw_die_ref context_die) 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 @@ -19238,8 +19237,7 @@ gen_subprogram_die (tree decl, dw_die_ref context_die) 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))) diff --git a/gcc/ipa-type-escape.c b/gcc/ipa-type-escape.c index 6b464df..1ecf68e 100644 --- a/gcc/ipa-type-escape.c +++ b/gcc/ipa-type-escape.c @@ -1025,7 +1025,7 @@ check_function_parameter_and_return_types (tree fn, bool escapes) { 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; @@ -1333,7 +1333,7 @@ check_call (gimple call) /* 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 diff --git a/gcc/lto/ChangeLog b/gcc/lto/ChangeLog index 1b15d91..319a47a 100644 --- a/gcc/lto/ChangeLog +++ b/gcc/lto/ChangeLog @@ -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> PR lto/46796 diff --git a/gcc/lto/lto-lang.c b/gcc/lto/lto-lang.c index de51eb0..968073b 100644 --- a/gcc/lto/lto-lang.c +++ b/gcc/lto/lto-lang.c @@ -313,7 +313,7 @@ handle_nonnull_attribute (tree *node, tree ARG_UNUSED (name), 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; } diff --git a/gcc/objc/ChangeLog b/gcc/objc/ChangeLog index d519ad7..2aae2f4 100644 --- a/gcc/objc/ChangeLog +++ b/gcc/objc/ChangeLog @@ -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> * objc-act.c (objc_init): Call using_eh_for_cleanups. diff --git a/gcc/objc/objc-act.c b/gcc/objc/objc-act.c index 2076111..2ac51bb 100644 --- a/gcc/objc/objc-act.c +++ b/gcc/objc/objc-act.c @@ -5126,7 +5126,7 @@ next_sjlj_build_enter_and_setjmp (void) 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); diff --git a/gcc/tree-ssa.c b/gcc/tree-ssa.c index 78497ce..7bd01f8 100644 --- a/gcc/tree-ssa.c +++ b/gcc/tree-ssa.c @@ -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)) == 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; @@ -1407,7 +1407,7 @@ useless_type_conversion_p (tree outer_type, tree inner_type) 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 |