This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[lto] Use vec_heap2parm_types in build_function_type_list.
- From: Kazu Hirata <kazu at codesourcery dot com>
- To: gcc-patches at gcc dot gnu dot org
- Date: Sun, 6 Aug 2006 07:25:52 -0700
- Subject: [lto] Use vec_heap2parm_types in build_function_type_list.
Hi,
Tested on x86_64-pc-linux-gnu. Committed to the LTO branch as
obvious.
Kazu Hirata
2006-08-06 Kazu Hirata <kazu@codesourcery.com>
* tree.c (build_function_type_list): Use vec_heap2parm_types.
Index: tree.c
===================================================================
--- tree.c (revision 115947)
+++ tree.c (working copy)
@@ -5297,18 +5297,20 @@ build_function_type (tree value_type, tr
tree
build_function_type_list (tree return_type, ...)
{
- tree t, args, *args_p = &args;
+ tree t, args;
+ VEC(tree,heap) *v = NULL;
va_list p;
va_start (p, return_type);
for (t = va_arg (p, tree); t != NULL_TREE; t = va_arg (p, tree))
- {
- *args_p = build_tree_list (NULL_TREE, t);
- args_p = &TREE_CHAIN (*args_p);
- }
+ VEC_safe_push (tree, heap, v, t);
+
+ VEC_safe_push (tree, heap, v, void_type_node);
+
+ args = vec_heap2parm_types (v);
+ VEC_free (tree, heap, v);
- *args_p = void_list_node;
args = build_function_type (return_type, args);
va_end (p);