gimple func_call;
arg_list = VEC_alloc (tree, heap, 2);
- argtype_list = void_list_node;
+ argtype_list = NULL_TREE;
while ((kind = va_arg (argp, enum aop_argkind)) != AOP_TERM_ARG)
{
/* Using tree_cons builds the list backwards! Un-backwards it. */
argtype_list = nreverse (argtype_list);
+ /* The last element of an argument list should always be
+ void_list_node, to signify that it is not a varargs argument
+ list. */
+ argtype_list = chainon (argtype_list, void_list_node);
+
func_type = build_function_type (return_type, argtype_list);
func_decl = build_fn_decl (func_name, func_type);
func_call = gimple_build_call_vec (func_decl, arg_list);