summaryrefslogtreecommitdiff
path: root/gcc/varray.c
diff options
context:
space:
mode:
authordnovillo <dnovillo@138bc75d-0d04-0410-961f-82ee72b054a4>2004-05-13 06:41:07 +0000
committerdnovillo <dnovillo@138bc75d-0d04-0410-961f-82ee72b054a4>2004-05-13 06:41:07 +0000
commit4ee9c6840ad3fc92a9034343278a1e476ad6872a (patch)
treea2568888a519c077427b133de9ece5879a8484a5 /gcc/varray.c
parentebb338380ab170c91e64d38038e6b5ce930d69a1 (diff)
downloadgcc-4ee9c6840ad3fc92a9034343278a1e476ad6872a.tar.gz
Merge tree-ssa-20020619-branch into mainline.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@81764 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/varray.c')
-rw-r--r--gcc/varray.c25
1 files changed, 24 insertions, 1 deletions
diff --git a/gcc/varray.c b/gcc/varray.c
index 9c70b9f6dad..fc951da56e4 100644
--- a/gcc/varray.c
+++ b/gcc/varray.c
@@ -99,6 +99,7 @@ static const struct {
{ sizeof (HOST_WIDE_INT), 1 },
{ sizeof (unsigned HOST_WIDE_INT), 1 },
{ sizeof (void *), 1 },
+ { sizeof (void *), 0 },
{ sizeof (char *), 1 },
{ sizeof (struct rtx_def *), 1 },
{ sizeof (struct rtvec_def *), 1 },
@@ -106,8 +107,10 @@ static const struct {
{ sizeof (struct bitmap_head_def *), 1 },
{ sizeof (struct reg_info_def *), 0 },
{ sizeof (struct const_equiv_data), 0 },
- { sizeof (struct basic_block_def *), 0 },
+ { sizeof (struct basic_block_def *), 1 },
{ sizeof (struct elt_list *), 1 },
+ { sizeof (struct edge_def *), 1 },
+ { sizeof (tree *), 1 },
};
/* Allocate a virtual array with NUM_ELEMENT elements, each of which is
@@ -207,6 +210,26 @@ varray_underflow (varray_type va, const char *file, int line,
#endif
+
+/* Copy varray V2 into varray V1. Both arrays must be the same size
+ and type. */
+
+void
+varray_copy (varray_type v1, varray_type v2)
+{
+ size_t data_size;
+
+ if (v1->type != v2->type)
+ abort ();
+
+ if (v1->num_elements != v2->num_elements)
+ abort ();
+
+ data_size = element[v2->type].size * v2->num_elements;
+ memcpy (v1->data.c, v2->data.c, data_size);
+ v1->elements_used = v2->elements_used;
+}
+
/* Output per-varray statistics. */
#ifdef GATHER_STATISTICS