aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp
diff options
context:
space:
mode:
authorNathan Sidwell <nathan@codesourcery.com>2004-09-16 15:21:41 +0000
committerNathan Sidwell <nathan@gcc.gnu.org>2004-09-16 15:21:41 +0000
commitd1f05f931e1689f7a0811acc39379831d40dcea9 (patch)
tree93415cafb5004bb88bc7ce318f4d4c5f76b6ca65 /gcc/cp
parent4b30ad7eef8f5a1b33130a999d0f62bd9de58056 (diff)
downloadgcc-d1f05f931e1689f7a0811acc39379831d40dcea9.zip
gcc-d1f05f931e1689f7a0811acc39379831d40dcea9.tar.gz
gcc-d1f05f931e1689f7a0811acc39379831d40dcea9.tar.bz2
class.c (copy_virtuals): Remove.
* class.c (copy_virtuals): Remove. (build_primary_vtable): Use copy_list directly. (build_secondary_vtable): Likewise. (update_vtable_entry_for_fn): Clear BV_CALL_INDEX here. (create_vtable_ptr): Likewise. From-SVN: r87604
Diffstat (limited to 'gcc/cp')
-rw-r--r--gcc/cp/ChangeLog8
-rw-r--r--gcc/cp/class.c24
2 files changed, 13 insertions, 19 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index bdca9bc..6c46adc 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,3 +1,11 @@
+2004-09-16 Nathan Sidwell <nathan@codesourcery.com>
+
+ * class.c (copy_virtuals): Remove.
+ (build_primary_vtable): Use copy_list directly.
+ (build_secondary_vtable): Likewise.
+ (update_vtable_entry_for_fn): Clear BV_CALL_INDEX here.
+ (create_vtable_ptr): Likewise.
+
2004-09-16 Kazu Hirata <kazu@cs.umass.edu>
* search.c: Follow spelling conventions.
diff --git a/gcc/cp/class.c b/gcc/cp/class.c
index a92bb8e..c16b872a 100644
--- a/gcc/cp/class.c
+++ b/gcc/cp/class.c
@@ -183,7 +183,6 @@ static void build_vcall_and_vbase_vtbl_entries (tree,
static void clone_constructors_and_destructors (tree);
static tree build_clone (tree, tree);
static void update_vtable_entry_for_fn (tree, tree, tree, tree *, unsigned);
-static tree copy_virtuals (tree);
static void build_ctor_vtbl_group (tree, tree);
static void build_vtt (tree);
static tree binfo_ctor_vtable (tree);
@@ -709,22 +708,6 @@ get_vtable_decl (tree type, int complete)
return decl;
}
-/* Returns a copy of the BINFO_VIRTUALS list in BINFO. The
- BV_VCALL_INDEX for each entry is cleared. */
-
-static tree
-copy_virtuals (tree binfo)
-{
- tree copies;
- tree t;
-
- copies = copy_list (BINFO_VIRTUALS (binfo));
- for (t = copies; t; t = TREE_CHAIN (t))
- BV_VCALL_INDEX (t) = NULL_TREE;
-
- return copies;
-}
-
/* Build the primary virtual function table for TYPE. If BINFO is
non-NULL, build the vtable starting with the initial approximation
that it is the same as the one which is the head of the association
@@ -746,7 +729,7 @@ build_primary_vtable (tree binfo, tree type)
no need to do it again. */
return 0;
- virtuals = copy_virtuals (binfo);
+ virtuals = copy_list (BINFO_VIRTUALS (binfo));
TREE_TYPE (decl) = TREE_TYPE (get_vtbl_decl_for_binfo (binfo));
DECL_SIZE (decl) = TYPE_SIZE (TREE_TYPE (decl));
DECL_SIZE_UNIT (decl) = TYPE_SIZE_UNIT (TREE_TYPE (decl));
@@ -797,7 +780,7 @@ build_secondary_vtable (tree binfo)
SET_BINFO_NEW_VTABLE_MARKED (binfo);
/* Make fresh virtual list, so we can smash it later. */
- BINFO_VIRTUALS (binfo) = copy_virtuals (binfo);
+ BINFO_VIRTUALS (binfo) = copy_list (BINFO_VIRTUALS (binfo));
/* Secondary vtables are laid out as part of the same structure as
the primary vtable. */
@@ -2237,6 +2220,8 @@ update_vtable_entry_for_fn (tree t, tree binfo, tree fn, tree* virtuals,
if (virtual_base)
BV_VCALL_INDEX (*virtuals)
= get_vcall_index (overrider_target, BINFO_TYPE (virtual_base));
+ else
+ BV_VCALL_INDEX (*virtuals) = NULL_TREE;
}
/* Called from modify_all_vtables via dfs_walk. */
@@ -4199,6 +4184,7 @@ create_vtable_ptr (tree t, tree* virtuals_p)
BV_FN (new_virtual) = fn;
BV_DELTA (new_virtual) = integer_zero_node;
+ BV_VCALL_INDEX (new_virtual) = NULL_TREE;
TREE_CHAIN (new_virtual) = *virtuals_p;
*virtuals_p = new_virtual;