Commit 1e625046 by Kazu Hirata Committed by Kazu Hirata

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
parent d7d461f7
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> 2005-05-07 Richard Sandiford <rsandifo@redhat.com>
* mangle.c: Remove a reference to the MIPS -mint64 option. * mangle.c: Remove a reference to the MIPS -mint64 option.
......
...@@ -80,7 +80,7 @@ typedef struct vtbl_init_data_s ...@@ -80,7 +80,7 @@ typedef struct vtbl_init_data_s
tree vbase; tree vbase;
/* The functions in vbase for which we have already provided vcall /* The functions in vbase for which we have already provided vcall
offsets. */ offsets. */
varray_type fns; VEC(tree,gc) *fns;
/* The vtable index of the next vcall or vbase offset. */ /* The vtable index of the next vcall or vbase offset. */
tree index; tree index;
/* Nonzero if we are building the initializer for the primary /* Nonzero if we are building the initializer for the primary
...@@ -7150,7 +7150,7 @@ build_vtbl_initializer (tree binfo, ...@@ -7150,7 +7150,7 @@ build_vtbl_initializer (tree binfo,
/* Create an array for keeping track of the functions we've /* Create an array for keeping track of the functions we've
processed. When we see multiple functions with the same processed. When we see multiple functions with the same
signature, we share the vcall offsets. */ 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. */ /* Add the vcall and vbase offset entries. */
build_vcall_and_vbase_vtbl_entries (binfo, &vid); build_vcall_and_vbase_vtbl_entries (binfo, &vid);
...@@ -7575,16 +7575,14 @@ add_vcall_offset (tree orig_fn, tree binfo, vtbl_init_data *vid) ...@@ -7575,16 +7575,14 @@ add_vcall_offset (tree orig_fn, tree binfo, vtbl_init_data *vid)
{ {
size_t i; size_t i;
tree vcall_offset; tree vcall_offset;
tree derived_entry;
/* If there is already an entry for a function with the same /* If there is already an entry for a function with the same
signature as FN, then we do not need a second vcall offset. signature as FN, then we do not need a second vcall offset.
Check the list of functions already present in the derived Check the list of functions already present in the derived
class vtable. */ 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) if (same_signature_p (derived_entry, orig_fn)
/* We only use one vcall offset for virtual destructors, /* We only use one vcall offset for virtual destructors,
even though there are two virtual table entries. */ even though there are two virtual table entries. */
...@@ -7611,7 +7609,7 @@ add_vcall_offset (tree orig_fn, tree binfo, vtbl_init_data *vid) ...@@ -7611,7 +7609,7 @@ add_vcall_offset (tree orig_fn, tree binfo, vtbl_init_data *vid)
ssize_int (TARGET_VTABLE_DATA_ENTRY_DISTANCE)); ssize_int (TARGET_VTABLE_DATA_ENTRY_DISTANCE));
/* Keep track of this function. */ /* 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) if (vid->generate_vcall_entries)
{ {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment