aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorMark Mitchell <mark@codesourcery.com>2000-01-17 05:12:39 +0000
committerMark Mitchell <mmitchel@gcc.gnu.org>2000-01-17 05:12:39 +0000
commit1eb4bea9e99660d553906b821561098e039d13dd (patch)
tree8e335965cfb0a27f94c9438c054a5d02f04d2ddd /gcc
parent39ac3e4f68b746afd0069f8c74355ecb34deeb73 (diff)
downloadgcc-1eb4bea9e99660d553906b821561098e039d13dd.zip
gcc-1eb4bea9e99660d553906b821561098e039d13dd.tar.gz
gcc-1eb4bea9e99660d553906b821561098e039d13dd.tar.bz2
class.c (finish_struct_1): Replace redundant code with assertions.
* class.c (finish_struct_1): Replace redundant code with assertions. From-SVN: r31454
Diffstat (limited to 'gcc')
-rw-r--r--gcc/cp/ChangeLog3
-rw-r--r--gcc/cp/class.c22
2 files changed, 14 insertions, 11 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index f8f2bdf..ae00eaf 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,5 +1,8 @@
2000-01-16 Mark Mitchell <mark@codesourcery.com>
+ * class.c (finish_struct_1): Replace redundant code with
+ assertions.
+
* cp-tree.h (flag_new_abi): Move.
(flag_use_cxa_atexit): Likewise.
(flag_honor_std): Likewise.
diff --git a/gcc/cp/class.c b/gcc/cp/class.c
index 8c1073e..9b14ded 100644
--- a/gcc/cp/class.c
+++ b/gcc/cp/class.c
@@ -4906,18 +4906,18 @@ finish_struct_1 (t)
if (TYPE_CONTAINS_VPTR_P (t))
{
+ if (TYPE_BINFO_VTABLE (t))
+ my_friendly_assert (DECL_VIRTUAL_P (TYPE_BINFO_VTABLE (t)),
+ 20000116);
+ if (!CLASSTYPE_HAS_PRIMARY_BASE_P (t))
+ my_friendly_assert (TYPE_BINFO_VIRTUALS (t) == NULL_TREE,
+ 20000116);
+
CLASSTYPE_VSIZE (t) = has_virtual;
- if (CLASSTYPE_HAS_PRIMARY_BASE_P (t))
- {
- if (pending_virtuals)
- TYPE_BINFO_VIRTUALS (t) = chainon (TYPE_BINFO_VIRTUALS (t),
- pending_virtuals);
- }
- else if (has_virtual)
- {
- TYPE_BINFO_VIRTUALS (t) = pending_virtuals;
- DECL_VIRTUAL_P (TYPE_BINFO_VTABLE (t)) = 1;
- }
+ /* Entries for virtual functions defined in the primary base are
+ followed by entries for new functions unique to this class. */
+ TYPE_BINFO_VIRTUALS (t)
+ = chainon (TYPE_BINFO_VIRTUALS (t), pending_virtuals);
}
/* Now lay out the virtual function table. */