aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/tree.c')
-rw-r--r--gcc/tree.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/gcc/tree.c b/gcc/tree.c
index d0202c3..45aacad 100644
--- a/gcc/tree.c
+++ b/gcc/tree.c
@@ -2123,6 +2123,21 @@ build_constructor_from_list (tree type, tree vals)
return build_constructor (type, v);
}
+/* Return a new CONSTRUCTOR node whose type is TYPE and whose values
+ are in a vector pointed to by VALS. Note that the TREE_PURPOSE
+ fields in the constructor remain null. */
+
+tree
+build_constructor_from_vec (tree type, const vec<tree, va_gc> *vals)
+{
+ vec<constructor_elt, va_gc> *v = NULL;
+
+ for (tree t : *vals)
+ CONSTRUCTOR_APPEND_ELT (v, NULL_TREE, t);
+
+ return build_constructor (type, v);
+}
+
/* Return a new CONSTRUCTOR node whose type is TYPE. NELTS is the number
of elements, provided as index/value pairs. */