Commit 132da1a5 by Joseph Myers Committed by Joseph Myers

c-typeck.c (comptypes, [...]): Remove flags parameter.

	* c-typeck.c (comptypes, tagged_types_tu_compatible_p,
	function_types_compatible_p, type_lists_compatible_p): Remove
	flags parameter.
	* c-tree.h (comptypes): Likewise.
	(COMPARE_STRICT): Remove.
	* c-decl.c, c-lang.c, c-parse.in, c-typeck.c, objc/objc-act.c: All
	callers changed.

From-SVN: r83061
parent 118a3a8b
2004-06-13 Joseph S. Myers <jsm@polyomino.org.uk>
* c-typeck.c (comptypes, tagged_types_tu_compatible_p,
function_types_compatible_p, type_lists_compatible_p): Remove
flags parameter.
* c-tree.h (comptypes): Likewise.
(COMPARE_STRICT): Remove.
* c-decl.c, c-lang.c, c-parse.in, c-typeck.c, objc/objc-act.c: All
callers changed.
2004-06-13 Eric Christopher <echristo@redhat.com> 2004-06-13 Eric Christopher <echristo@redhat.com>
* c-decl.c (diagnose_mismatched_decls): Improve error message. * c-decl.c (diagnose_mismatched_decls): Improve error message.
......
...@@ -936,7 +936,7 @@ diagnose_arglist_conflict (tree newdecl, tree olddecl, ...@@ -936,7 +936,7 @@ diagnose_arglist_conflict (tree newdecl, tree olddecl,
tree t; tree t;
if (TREE_CODE (olddecl) != FUNCTION_DECL if (TREE_CODE (olddecl) != FUNCTION_DECL
|| !comptypes (TREE_TYPE (oldtype), TREE_TYPE (newtype), COMPARE_STRICT) || !comptypes (TREE_TYPE (oldtype), TREE_TYPE (newtype))
|| !((TYPE_ARG_TYPES (oldtype) == 0 && DECL_INITIAL (olddecl) == 0) || !((TYPE_ARG_TYPES (oldtype) == 0 && DECL_INITIAL (olddecl) == 0)
|| ||
(TYPE_ARG_TYPES (newtype) == 0 && DECL_INITIAL (newdecl) == 0))) (TYPE_ARG_TYPES (newtype) == 0 && DECL_INITIAL (newdecl) == 0)))
...@@ -1008,7 +1008,7 @@ validate_proto_after_old_defn (tree newdecl, tree newtype, tree oldtype) ...@@ -1008,7 +1008,7 @@ validate_proto_after_old_defn (tree newdecl, tree newtype, tree oldtype)
/* Type for passing arg must be consistent with that declared /* Type for passing arg must be consistent with that declared
for the arg. */ for the arg. */
else if (! comptypes (oldargtype, newargtype, COMPARE_STRICT)) else if (! comptypes (oldargtype, newargtype))
{ {
error ("%Jprototype for '%D' declares arg %d with incompatible type", error ("%Jprototype for '%D' declares arg %d with incompatible type",
newdecl, newdecl, i); newdecl, newdecl, i);
...@@ -1090,7 +1090,7 @@ diagnose_mismatched_decls (tree newdecl, tree olddecl, ...@@ -1090,7 +1090,7 @@ diagnose_mismatched_decls (tree newdecl, tree olddecl,
return false; return false;
} }
if (!comptypes (oldtype, newtype, COMPARE_STRICT)) if (!comptypes (oldtype, newtype))
{ {
if (TREE_CODE (olddecl) == FUNCTION_DECL if (TREE_CODE (olddecl) == FUNCTION_DECL
&& DECL_BUILT_IN (olddecl) && !C_DECL_DECLARED_BUILTIN (olddecl)) && DECL_BUILT_IN (olddecl) && !C_DECL_DECLARED_BUILTIN (olddecl))
...@@ -1099,7 +1099,7 @@ diagnose_mismatched_decls (tree newdecl, tree olddecl, ...@@ -1099,7 +1099,7 @@ diagnose_mismatched_decls (tree newdecl, tree olddecl,
This is for the ffs and fprintf builtins. */ This is for the ffs and fprintf builtins. */
tree trytype = match_builtin_function_types (newtype, oldtype); tree trytype = match_builtin_function_types (newtype, oldtype);
if (trytype && comptypes (newtype, trytype, COMPARE_STRICT)) if (trytype && comptypes (newtype, trytype))
*oldtypep = oldtype = trytype; *oldtypep = oldtype = trytype;
else else
{ {
...@@ -6008,8 +6008,7 @@ store_parm_decls_oldstyle (tree fndecl, tree arg_info) ...@@ -6008,8 +6008,7 @@ store_parm_decls_oldstyle (tree fndecl, tree arg_info)
declared for the arg. ISO C says we take the unqualified declared for the arg. ISO C says we take the unqualified
type for parameters declared with qualified type. */ type for parameters declared with qualified type. */
if (! comptypes (TYPE_MAIN_VARIANT (DECL_ARG_TYPE (parm)), if (! comptypes (TYPE_MAIN_VARIANT (DECL_ARG_TYPE (parm)),
TYPE_MAIN_VARIANT (TREE_VALUE (type)), TYPE_MAIN_VARIANT (TREE_VALUE (type))))
COMPARE_STRICT))
{ {
if (TYPE_MAIN_VARIANT (TREE_TYPE (parm)) if (TYPE_MAIN_VARIANT (TREE_TYPE (parm))
== TYPE_MAIN_VARIANT (TREE_VALUE (type))) == TYPE_MAIN_VARIANT (TREE_VALUE (type)))
......
...@@ -216,7 +216,7 @@ finish_file (void) ...@@ -216,7 +216,7 @@ finish_file (void)
int int
c_types_compatible_p (tree x, tree y) c_types_compatible_p (tree x, tree y)
{ {
return comptypes (TYPE_MAIN_VARIANT (x), TYPE_MAIN_VARIANT (y), 0); return comptypes (TYPE_MAIN_VARIANT (x), TYPE_MAIN_VARIANT (y));
} }
static void static void
c_initialize_diagnostics (diagnostic_context *context) c_initialize_diagnostics (diagnostic_context *context)
......
...@@ -700,7 +700,7 @@ primary: ...@@ -700,7 +700,7 @@ primary:
e1 = TYPE_MAIN_VARIANT (groktypename ($3)); e1 = TYPE_MAIN_VARIANT (groktypename ($3));
e2 = TYPE_MAIN_VARIANT (groktypename ($5)); e2 = TYPE_MAIN_VARIANT (groktypename ($5));
$$ = comptypes (e1, e2, COMPARE_STRICT) $$ = comptypes (e1, e2)
? build_int_2 (1, 0) : build_int_2 (0, 0); ? build_int_2 (1, 0) : build_int_2 (0, 0);
} }
| TYPES_COMPATIBLE_P '(' error ')' | TYPES_COMPATIBLE_P '(' error ')'
......
...@@ -214,14 +214,9 @@ extern bool c_warn_unused_global_decl (tree); ...@@ -214,14 +214,9 @@ extern bool c_warn_unused_global_decl (tree);
/* in c-typeck.c */ /* in c-typeck.c */
/* For use with comptypes. */
enum {
COMPARE_STRICT = 0
};
extern tree require_complete_type (tree); extern tree require_complete_type (tree);
extern int same_translation_unit_p (tree, tree); extern int same_translation_unit_p (tree, tree);
extern int comptypes (tree, tree, int); extern int comptypes (tree, tree);
extern tree c_size_in_bytes (tree); extern tree c_size_in_bytes (tree);
extern bool c_mark_addressable (tree); extern bool c_mark_addressable (tree);
extern void c_incomplete_type_error (tree, tree); extern void c_incomplete_type_error (tree, tree);
......
/* Implement classes and message passing for Objective C. /* Implement classes and message passing for Objective C.
Copyright (C) 1992, 1993, 1994, 1995, 1997, 1998, 1999, 2000, Copyright (C) 1992, 1993, 1994, 1995, 1997, 1998, 1999, 2000,
2001, 2002, 2003 Free Software Foundation, Inc. 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
Contributed by Steve Naroff. Contributed by Steve Naroff.
This file is part of GCC. This file is part of GCC.
...@@ -4257,7 +4257,7 @@ check_ivars (tree inter, tree imp) ...@@ -4257,7 +4257,7 @@ check_ivars (tree inter, tree imp)
t1 = TREE_TYPE (intdecls); t2 = TREE_TYPE (impdecls); t1 = TREE_TYPE (intdecls); t2 = TREE_TYPE (impdecls);
if (!comptypes (t1, t2, false) if (!comptypes (t1, t2)
|| !tree_int_cst_equal (TREE_VALUE (TREE_VALUE (rawintdecls)), || !tree_int_cst_equal (TREE_VALUE (TREE_VALUE (rawintdecls)),
TREE_VALUE (TREE_VALUE (rawimpdecls)))) TREE_VALUE (TREE_VALUE (rawimpdecls))))
{ {
...@@ -7612,8 +7612,7 @@ comp_method_with_proto (tree method, tree proto) ...@@ -7612,8 +7612,7 @@ comp_method_with_proto (tree method, tree proto)
/* install return type */ /* install return type */
TREE_TYPE (function1_template) = groktypename (TREE_TYPE (proto)); TREE_TYPE (function1_template) = groktypename (TREE_TYPE (proto));
return comptypes (TREE_TYPE (METHOD_DEFINITION (method)), function1_template, return comptypes (TREE_TYPE (METHOD_DEFINITION (method)), function1_template);
false);
} }
/* Return 1 if TYPE1 is equivalent to TYPE2. */ /* Return 1 if TYPE1 is equivalent to TYPE2. */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment