diff options
author | Mark Mitchell <mark@markmitchell.com> | 1998-10-26 23:48:58 +0000 |
---|---|---|
committer | Mark Mitchell <mmitchel@gcc.gnu.org> | 1998-10-26 23:48:58 +0000 |
commit | 52bf7d5d090f026c1e72949f6556b392fdd839ec (patch) | |
tree | fa8101d9dcabb5f1cf651dceaf682d01104640fe | |
parent | ad3ef78e25a7f3ec042403fe1f353226f3962477 (diff) | |
download | gcc-52bf7d5d090f026c1e72949f6556b392fdd839ec.zip gcc-52bf7d5d090f026c1e72949f6556b392fdd839ec.tar.gz gcc-52bf7d5d090f026c1e72949f6556b392fdd839ec.tar.bz2 |
error.c (dump_decl): Deal with TEMPLATE_DECLs that are VAR_DECLs.
* error.c (dump_decl): Deal with TEMPLATE_DECLs that are
VAR_DECLs. Handle vtables whose DECL_CONTEXT is not a type.
* class.c (finish_struct_1): Use build_cplus_array_type to build
array types.
* decl.c (init_decl_processing): Likewise.
* except.c (expand_end_eh_spec): Likewise.
* search.c (expand_upcast_fixups): Simplify very slightly.
From-SVN: r23359
-rw-r--r-- | gcc/cp/ChangeLog | 11 | ||||
-rw-r--r-- | gcc/cp/class.c | 2 | ||||
-rw-r--r-- | gcc/cp/decl.c | 2 | ||||
-rw-r--r-- | gcc/cp/error.c | 10 | ||||
-rw-r--r-- | gcc/cp/except.c | 2 | ||||
-rw-r--r-- | gcc/cp/search.c | 2 |
6 files changed, 24 insertions, 5 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 5506568..8c3123b 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,14 @@ +1998-10-26 Mark Mitchell <mark@markmitchell.com> + + * error.c (dump_decl): Deal with TEMPLATE_DECLs that are + VAR_DECLs. Handle vtables whose DECL_CONTEXT is not a type. + + * class.c (finish_struct_1): Use build_cplus_array_type to build + array types. + * decl.c (init_decl_processing): Likewise. + * except.c (expand_end_eh_spec): Likewise. + * search.c (expand_upcast_fixups): Simplify very slightly. + 1998-10-26 Jason Merrill <jason@yorick.cygnus.com> * decl.c (grokdeclarator): Complain about a variable using diff --git a/gcc/cp/class.c b/gcc/cp/class.c index 8141db1..6245700 100644 --- a/gcc/cp/class.c +++ b/gcc/cp/class.c @@ -4155,7 +4155,7 @@ finish_struct_1 (t, warn_anon) { /* Use size_int so values are memoized in common cases. */ tree itype = build_index_type (size_int (has_virtual)); - tree atype = build_array_type (vtable_entry_type, itype); + tree atype = build_cplus_array_type (vtable_entry_type, itype); layout_type (atype); diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c index f516746..87b8d50 100644 --- a/gcc/cp/decl.c +++ b/gcc/cp/decl.c @@ -6208,7 +6208,7 @@ init_decl_processing () record_builtin_type (RID_MAX, VTBL_PTR_TYPE, vtable_entry_type); vtbl_type_node - = build_array_type (vtable_entry_type, NULL_TREE); + = build_cplus_array_type (vtable_entry_type, NULL_TREE); layout_type (vtbl_type_node); vtbl_type_node = build_qualified_type (vtbl_type_node, TYPE_QUAL_CONST); record_builtin_type (RID_MAX, NULL_PTR, vtbl_type_node); diff --git a/gcc/cp/error.c b/gcc/cp/error.c index 002473a..bd7d178 100644 --- a/gcc/cp/error.c +++ b/gcc/cp/error.c @@ -729,7 +729,13 @@ dump_decl (t, v) if (DECL_NAME (t) && VTABLE_NAME_P (DECL_NAME (t))) { OB_PUTS ("vtable for "); - dump_type (DECL_CONTEXT (t), v); + if (TYPE_P (DECL_CONTEXT (t))) + dump_type (DECL_CONTEXT (t), v); + else + /* This case can arise with -fno-vtable-thunks. See + expand_upcast_fixups. It's not clear what to print + here. */ + OB_PUTS ("{unknown type}"); break; } /* else fall through */ @@ -863,6 +869,8 @@ dump_decl (t, v) if (TREE_CODE (DECL_TEMPLATE_RESULT (t)) == TYPE_DECL) dump_type (TREE_TYPE (t), v); + else if (TREE_CODE (DECL_TEMPLATE_RESULT (t)) == VAR_DECL) + dump_decl (DECL_TEMPLATE_RESULT (t), v); else if (TREE_TYPE (t) == NULL_TREE) my_friendly_abort (353); else switch (NEXT_CODE (t)) diff --git a/gcc/cp/except.c b/gcc/cp/except.c index c21ac24..2d069da 100644 --- a/gcc/cp/except.c +++ b/gcc/cp/except.c @@ -774,7 +774,7 @@ expand_end_eh_spec (raises) TREE_HAS_CONSTRUCTOR (types) = 1; /* We can't pass the CONSTRUCTOR directly, so stick it in a variable. */ - tmp = build_array_type (const_ptr_type_node, NULL_TREE); + tmp = build_cplus_array_type (const_ptr_type_node, NULL_TREE); decl = build_decl (VAR_DECL, NULL_TREE, tmp); DECL_ARTIFICIAL (decl) = 1; DECL_INITIAL (decl) = types; diff --git a/gcc/cp/search.c b/gcc/cp/search.c index 5af1c7d..c49fd22 100644 --- a/gcc/cp/search.c +++ b/gcc/cp/search.c @@ -2542,7 +2542,7 @@ expand_upcast_fixups (binfo, addr, orig_addr, vbase, vbase_addr, t, /* Dup it if it isn't in local scope yet. */ nvtbl = build_decl (VAR_DECL, DECL_NAME (vtbl), - TYPE_MAIN_VARIANT (TREE_TYPE (BINFO_VTABLE (binfo)))); + TYPE_MAIN_VARIANT (TREE_TYPE (vtbl))); DECL_ALIGN (nvtbl) = MAX (TYPE_ALIGN (double_type_node), DECL_ALIGN (nvtbl)); TREE_READONLY (nvtbl) = 0; |