Commit a3409c02 by Jason Merrill Committed by Jason Merrill

tree.c (build_constructor_va): New.

	* tree.c (build_constructor_va): New.
	* tree.h: Declare it.

From-SVN: r198744
parent 66e6b990
2013-05-09 Jason Merrill <jason@redhat.com>
* tree.c (build_constructor_va): New.
* tree.h: Declare it.
2013-05-09 Martin Jambor <mjambor@suse.cz> 2013-05-09 Martin Jambor <mjambor@suse.cz>
PR lto/57084 PR lto/57084
......
...@@ -1467,6 +1467,27 @@ build_constructor_from_list (tree type, tree vals) ...@@ -1467,6 +1467,27 @@ build_constructor_from_list (tree type, tree vals)
return build_constructor (type, v); 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. */
tree
build_constructor_va (tree type, int nelts, ...)
{
vec<constructor_elt, va_gc> *v = NULL;
va_list p;
va_start (p, nelts);
vec_alloc (v, nelts);
while (nelts--)
{
tree index = va_arg (p, tree);
tree value = va_arg (p, tree);
CONSTRUCTOR_APPEND_ELT (v, index, value);
}
va_end (p);
return build_constructor (type, v);
}
/* Return a new FIXED_CST node whose type is TYPE and value is F. */ /* Return a new FIXED_CST node whose type is TYPE and value is F. */
tree tree
......
...@@ -4763,6 +4763,7 @@ extern tree build_vector_from_val (tree, tree); ...@@ -4763,6 +4763,7 @@ extern tree build_vector_from_val (tree, tree);
extern tree build_constructor (tree, vec<constructor_elt, va_gc> *); extern tree build_constructor (tree, vec<constructor_elt, va_gc> *);
extern tree build_constructor_single (tree, tree, tree); extern tree build_constructor_single (tree, tree, tree);
extern tree build_constructor_from_list (tree, tree); extern tree build_constructor_from_list (tree, tree);
extern tree build_constructor_va (tree, int, ...);
extern tree build_real_from_int_cst (tree, const_tree); extern tree build_real_from_int_cst (tree, const_tree);
extern tree build_complex (tree, tree, tree); extern tree build_complex (tree, tree, tree);
extern tree build_one_cst (tree); extern tree build_one_cst (tree);
......
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