diff options
| author | Mark Mitchell <mark@codesourcery.com> | 2000-05-03 22:25:21 +0000 |
|---|---|---|
| committer | Mark Mitchell <mmitchel@gcc.gnu.org> | 2000-05-03 22:25:21 +0000 |
| commit | eb68cb58219314b2df94efec3b9dc711b830f7e3 (patch) | |
| tree | fb395af6f8b13f1f1cb8bcb18746ecc90790f4c6 /gcc/cp/decl.c | |
| parent | 6428983a537afa26f27545f5579eb594bc6407e0 (diff) | |
| download | gcc-eb68cb58219314b2df94efec3b9dc711b830f7e3.zip gcc-eb68cb58219314b2df94efec3b9dc711b830f7e3.tar.gz gcc-eb68cb58219314b2df94efec3b9dc711b830f7e3.tar.bz2 | |
cp-tree.def (THUNK_DECL): Remove.
* cp-tree.def (THUNK_DECL): Remove.
* cp-tree.h (DECL_THUNK_P): New macro.
(DECL_NON_THUNK_FUNCTION_P): Likewise.
(DECL_EXTERN_C_FUNCTION_P): Likewise.
(SET_DECL_THUNK_P): Likewise.
(DELTA_FROM_VTABLE_ENTRY): Use DECL_THUNK_P.
(FNADDR_FROM_VTABLE_ENTRY): Likewise.
(DECL_MAIN_P): Use DECL_EXTERN_C_FUNCTION_P.
* decl.c (decls_match): Use DECL_EXTERN_C_P.
(duplicate_decls): Likewise.
(pushdecl): Likewise. Adjust thunk handling.
(grokfndecl): Use DECL_EXTERN_C_P.
* decl2.c (mark_vtable_entries): Use DECL_THUNK_P.
* dump.c (dequeue_and_dump): Remove THUNK_DECL handling.
* except.c (nothrow_libfn_p): Use DECL_EXTERN_C_P.
* expr.c (cplus_expand_expr): Remove THUNK_DECL handling.
* method.c (make_thunk): Use SET_DECL_THUNK_P. Set
DECL_NO_STATIC_CHAIN.
(emit_thunk): Don't play games with TREE_CODE on thunks. Don't
set DECL_DESTRUCTOR_P or DECL_CONSTRUCTOR_P on a thunk.
* search.c (covariant_return_p): Remove THUNK_DECL handling.
* ir.texi: Update.
From-SVN: r33647
Diffstat (limited to 'gcc/cp/decl.c')
| -rw-r--r-- | gcc/cp/decl.c | 33 |
1 files changed, 16 insertions, 17 deletions
diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c index 3853df1..c792e74 100644 --- a/gcc/cp/decl.c +++ b/gcc/cp/decl.c @@ -2927,8 +2927,8 @@ decls_match (newdecl, olddecl) tree p2 = TYPE_ARG_TYPES (f2); if (CP_DECL_CONTEXT (newdecl) != CP_DECL_CONTEXT (olddecl) - && ! (DECL_LANGUAGE (newdecl) == lang_c - && DECL_LANGUAGE (olddecl) == lang_c)) + && ! (DECL_EXTERN_C_P (newdecl) + && DECL_EXTERN_C_P (olddecl))) return 0; if (TREE_CODE (f1) != TREE_CODE (f2)) @@ -2937,15 +2937,17 @@ decls_match (newdecl, olddecl) if (same_type_p (TREE_TYPE (f1), TREE_TYPE (f2))) { if ((! strict_prototypes_lang_c || DECL_BUILT_IN (olddecl)) - && DECL_LANGUAGE (olddecl) == lang_c + && DECL_EXTERN_C_P (olddecl) && p2 == NULL_TREE) { types_match = self_promoting_args_p (p1); if (p1 == void_list_node) TREE_TYPE (newdecl) = TREE_TYPE (olddecl); } - else if (!strict_prototypes_lang_c && DECL_LANGUAGE (olddecl)==lang_c - && DECL_LANGUAGE (newdecl) == lang_c && p1 == NULL_TREE) + else if (!strict_prototypes_lang_c + && DECL_EXTERN_C_P (olddecl) + && DECL_EXTERN_C_P (newdecl) + && p1 == NULL_TREE) { types_match = self_promoting_args_p (p2); TREE_TYPE (newdecl) = TREE_TYPE (olddecl); @@ -3094,8 +3096,8 @@ duplicate_decls (newdecl, olddecl) } else if (!types_match) { - if ((DECL_LANGUAGE (newdecl) == lang_c - && DECL_LANGUAGE (olddecl) == lang_c) + if ((DECL_EXTERN_C_P (newdecl) + && DECL_EXTERN_C_P (olddecl)) || compparms (TYPE_ARG_TYPES (TREE_TYPE (newdecl)), TYPE_ARG_TYPES (TREE_TYPE (olddecl)))) { @@ -3203,8 +3205,7 @@ duplicate_decls (newdecl, olddecl) } if (TREE_CODE (newdecl) == FUNCTION_DECL) { - if (DECL_LANGUAGE (newdecl) == lang_c - && DECL_LANGUAGE (olddecl) == lang_c) + if (DECL_EXTERN_C_P (newdecl) && DECL_EXTERN_C_P (olddecl)) { cp_error ("declaration of C function `%#D' conflicts with", newdecl); @@ -3801,7 +3802,7 @@ pushdecl (x) if (duplicate_decls (x, t)) return t; } - else if (((TREE_CODE (x) == FUNCTION_DECL && DECL_LANGUAGE (x) == lang_c) + else if ((DECL_EXTERN_C_FUNCTION_P (x) || DECL_FUNCTION_TEMPLATE_P (x)) && is_overloaded_fn (t)) /* Don't do anything just yet. */; @@ -3877,14 +3878,13 @@ pushdecl (x) /* If this is a function conjured up by the backend, massage it so it looks friendly. */ - if (TREE_CODE (x) == FUNCTION_DECL - && ! DECL_LANG_SPECIFIC (x)) + if (DECL_NON_THUNK_FUNCTION_P (x) && ! DECL_LANG_SPECIFIC (x)) { retrofit_lang_decl (x); DECL_LANGUAGE (x) = lang_c; } - if (TREE_CODE (x) == FUNCTION_DECL && ! DECL_FUNCTION_MEMBER_P (x)) + if (DECL_NON_THUNK_FUNCTION_P (x) && ! DECL_FUNCTION_MEMBER_P (x)) { t = push_overloaded_decl (x, PUSH_LOCAL); if (t != x) @@ -3980,8 +3980,7 @@ pushdecl (x) the mangled name (i.e., NAME) to the DECL. But, for an `extern "C"' function, the mangled name and the ordinary name are the same so we need not do this. */ - && !(TREE_CODE (x) == FUNCTION_DECL && - DECL_LANGUAGE (x) == lang_c)) + && !DECL_EXTERN_C_FUNCTION_P (x)) { if (TREE_CODE (x) == FUNCTION_DECL) my_friendly_assert @@ -8711,7 +8710,7 @@ grokfndecl (ctype, type, declarator, orig_declarator, virtualp, flags, quals, { if (ANON_AGGRNAME_P (TYPE_IDENTIFIER (t))) { - if (DECL_LANGUAGE (decl) == lang_c) + if (DECL_EXTERN_C_P (decl)) /* Allow this; it's pretty common in C. */; else cp_pedwarn ("non-local function `%#D' uses anonymous type", @@ -8802,7 +8801,7 @@ grokfndecl (ctype, type, declarator, orig_declarator, virtualp, flags, quals, /* Plain overloading: will not be grok'd by grokclassfn. */ if (! ctype && ! processing_template_decl - && DECL_LANGUAGE (decl) != lang_c + && !DECL_EXTERN_C_P (decl) && (! DECL_USE_TEMPLATE (decl) || name_mangling_version < 1)) set_mangled_name_for_decl (decl); |
