summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorkazu <kazu@138bc75d-0d04-0410-961f-82ee72b054a4>2005-05-08 02:17:54 +0000
committerkazu <kazu@138bc75d-0d04-0410-961f-82ee72b054a4>2005-05-08 02:17:54 +0000
commitcc331293d5e7b3edd5f64edbfd19310f846aca95 (patch)
tree8fb10aa6914022465955027d7b51eca2f86f7666
parent0f1bff63e02b739e234e0edab9875a6bce49b2ed (diff)
downloadppe42-gcc-cc331293d5e7b3edd5f64edbfd19310f846aca95.tar.gz
ppe42-gcc-cc331293d5e7b3edd5f64edbfd19310f846aca95.zip
* class.c (vtbl_init_data_s): Change the type of fns to
VEC(tree,gc)*. (build_vtbl_initializer, add_vcall_offset, add_vcall_offset): Use VEC instead of VARRAY. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@99376 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--gcc/cp/ChangeLog7
-rw-r--r--gcc/cp/class.c12
2 files changed, 12 insertions, 7 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index c16efa39e96..50523410176 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,3 +1,10 @@
+2005-05-08 Kazu Hirata <kazu@cs.umass.edu>
+
+ * class.c (vtbl_init_data_s): Change the type of fns to
+ VEC(tree,gc)*.
+ (build_vtbl_initializer, add_vcall_offset, add_vcall_offset):
+ Use VEC instead of VARRAY.
+
2005-05-07 Richard Sandiford <rsandifo@redhat.com>
* mangle.c: Remove a reference to the MIPS -mint64 option.
diff --git a/gcc/cp/class.c b/gcc/cp/class.c
index 6217a2cce7f..b70fb1f2165 100644
--- a/gcc/cp/class.c
+++ b/gcc/cp/class.c
@@ -80,7 +80,7 @@ typedef struct vtbl_init_data_s
tree vbase;
/* The functions in vbase for which we have already provided vcall
offsets. */
- varray_type fns;
+ VEC(tree,gc) *fns;
/* The vtable index of the next vcall or vbase offset. */
tree index;
/* Nonzero if we are building the initializer for the primary
@@ -7150,7 +7150,7 @@ build_vtbl_initializer (tree binfo,
/* Create an array for keeping track of the functions we've
processed. When we see multiple functions with the same
signature, we share the vcall offsets. */
- VARRAY_TREE_INIT (vid.fns, 32, "fns");
+ vid.fns = VEC_alloc (tree, gc, 32);
/* Add the vcall and vbase offset entries. */
build_vcall_and_vbase_vtbl_entries (binfo, &vid);
@@ -7575,16 +7575,14 @@ add_vcall_offset (tree orig_fn, tree binfo, vtbl_init_data *vid)
{
size_t i;
tree vcall_offset;
+ tree derived_entry;
/* If there is already an entry for a function with the same
signature as FN, then we do not need a second vcall offset.
Check the list of functions already present in the derived
class vtable. */
- for (i = 0; i < VARRAY_ACTIVE_SIZE (vid->fns); ++i)
+ for (i = 0; VEC_iterate (tree, vid->fns, i, derived_entry); ++i)
{
- tree derived_entry;
-
- derived_entry = VARRAY_TREE (vid->fns, i);
if (same_signature_p (derived_entry, orig_fn)
/* We only use one vcall offset for virtual destructors,
even though there are two virtual table entries. */
@@ -7611,7 +7609,7 @@ add_vcall_offset (tree orig_fn, tree binfo, vtbl_init_data *vid)
ssize_int (TARGET_VTABLE_DATA_ENTRY_DISTANCE));
/* Keep track of this function. */
- VARRAY_PUSH_TREE (vid->fns, orig_fn);
+ VEC_safe_push (tree, gc, vid->fns, orig_fn);
if (vid->generate_vcall_entries)
{
OpenPOWER on IntegriCloud