This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[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);


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]