From: Kazu Hirata Date: Sun, 8 May 2005 02:17:54 +0000 (+0000) Subject: class.c (vtbl_init_data_s): Change the type of fns to VEC(tree,gc)*. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=1e625046b81c10ad9488acdb3b3d1ddcb2ee3083;p=gcc.git 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 --- 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 + + * 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 * 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) {