class.c (vtbl_init_data_s): Change the type of fns to VEC(tree,gc)*.

* 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.

From-SVN: r99376
This commit is contained in:
Kazu Hirata 2005-05-08 02:17:54 +00:00 committed by Kazu Hirata
parent d7d461f765
commit 1e625046b8
2 changed files with 12 additions and 7 deletions

View File

@ -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.

View File

@ -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)
{