diff options
author | Zack Weinberg <zack@codesourcery.com> | 2003-08-30 21:24:19 +0000 |
---|---|---|
committer | Zack Weinberg <zack@gcc.gnu.org> | 2003-08-30 21:24:19 +0000 |
commit | 766beae18707b9c9918bac392c8340d84aceffd1 (patch) | |
tree | 224ec6b140b0764f4f59fa98e93fdcd681438b8c /gcc/c-decl.c | |
parent | bf7a697f0ad4399b6ef6abc542520c9be858356e (diff) | |
download | gcc-766beae18707b9c9918bac392c8340d84aceffd1.zip gcc-766beae18707b9c9918bac392c8340d84aceffd1.tar.gz gcc-766beae18707b9c9918bac392c8340d84aceffd1.tar.bz2 |
c-tree.h: Delete COMPARE_DIFFERENT_TU from enumeration.
* c-tree.h: Delete COMPARE_DIFFERENT_TU from enumeration.
* c-typeck.c (same_translation_unit_p): New function.
(comptypes): Use it instead of flags parameter to identify
structure types from different translation units.
* c-decl.c (duplicate_decls): Always call comptypes with
COMPTYPE_STRICT flags argument.
(c_reset_state): Set BLOCK_SUPERCONTEXT of the block formed
to file_scope_decl.
From-SVN: r70953
Diffstat (limited to 'gcc/c-decl.c')
-rw-r--r-- | gcc/c-decl.c | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/gcc/c-decl.c b/gcc/c-decl.c index a346516..20b9b67 100644 --- a/gcc/c-decl.c +++ b/gcc/c-decl.c @@ -775,10 +775,8 @@ static int duplicate_decls (tree newdecl, tree olddecl, int different_binding_level, int different_tu) { - int comptype_flags = (different_tu ? COMPARE_DIFFERENT_TU - : COMPARE_STRICT); int types_match = comptypes (TREE_TYPE (newdecl), TREE_TYPE (olddecl), - comptype_flags); + COMPARE_STRICT); int new_is_definition = (TREE_CODE (newdecl) == FUNCTION_DECL && DECL_INITIAL (newdecl) != 0); tree oldtype = TREE_TYPE (olddecl); @@ -897,7 +895,7 @@ duplicate_decls (tree newdecl, tree olddecl, int different_binding_level, if (trytype) { - types_match = comptypes (newtype, trytype, comptype_flags); + types_match = comptypes (newtype, trytype, COMPARE_STRICT); if (types_match) oldtype = trytype; if (! different_binding_level) @@ -983,7 +981,7 @@ duplicate_decls (tree newdecl, tree olddecl, int different_binding_level, && ! pedantic /* Return types must still match. */ && comptypes (TREE_TYPE (oldtype), - TREE_TYPE (newtype), comptype_flags) + TREE_TYPE (newtype), COMPARE_STRICT) && TYPE_ARG_TYPES (newtype) == 0)) { error ("%Hconflicting types for '%D'", @@ -992,7 +990,7 @@ duplicate_decls (tree newdecl, tree olddecl, int different_binding_level, involving an empty arglist vs a nonempty one. */ if (TREE_CODE (olddecl) == FUNCTION_DECL && comptypes (TREE_TYPE (oldtype), - TREE_TYPE (newtype), comptype_flags) + TREE_TYPE (newtype), COMPARE_STRICT) && ((TYPE_ARG_TYPES (oldtype) == 0 && DECL_INITIAL (olddecl) == 0) || @@ -1135,7 +1133,7 @@ duplicate_decls (tree newdecl, tree olddecl, int different_binding_level, /* Type for passing arg must be consistent with that declared for the arg. */ if (! comptypes (TREE_VALUE (parm), TREE_VALUE (type), - comptype_flags)) + COMPARE_STRICT)) { const location_t *locus = &DECL_SOURCE_LOCATION (newdecl); error ("%Hprototype for '%D' follows and argument %d " @@ -6701,6 +6699,7 @@ c_reset_state (void) current_scope = global_scope; file_scope_decl = current_file_decl; DECL_INITIAL (file_scope_decl) = poplevel (1, 0, 0); + BLOCK_SUPERCONTEXT (DECL_INITIAL (file_scope_decl)) = file_scope_decl; truly_local_externals = NULL_TREE; /* Start a new global binding level. */ |