summaryrefslogtreecommitdiff
path: root/gcc/tree.c
diff options
context:
space:
mode:
authorAldy Hernandez <aldyh@redhat.com>2002-06-30 01:19:58 +0000
committerAldy Hernandez <aldyh@gcc.gnu.org>2002-06-30 01:19:58 +0000
commitb4de2f7db73c5331446fe1af9678a874d4958bae (patch)
tree551f8946278e801b4d603f4a0a4dbc717e5588fe /gcc/tree.c
parent1691051fc987751fdc596faf2069be5fa7be3cee (diff)
downloadgcc-b4de2f7db73c5331446fe1af9678a874d4958bae.tar.gz
i386.c (ix86_init_mmx_sse_builtins): Use build_function_type_list instead of build_function_type.
2002-06-29 Aldy Hernandez <aldyh@redhat.com> * config/i386/i386.c (ix86_init_mmx_sse_builtins): Use build_function_type_list instead of build_function_type. * config/ia64/ia64.c (ia64_init_builtins): Same. * config/alpha/alpha.c (alpha_init_builtins): Same. * config/rs6000/rs6000.c (altivec_init_builtins): Same. * config/arm/arm.c (arm_init_builtins): Same. * tree.h: Add build_function_type_list prototype. * tree.c (build_function_type_list): New. From-SVN: r55109
Diffstat (limited to 'gcc/tree.c')
-rw-r--r--gcc/tree.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/gcc/tree.c b/gcc/tree.c
index 512e523cdc4..78364e1e3f4 100644
--- a/gcc/tree.c
+++ b/gcc/tree.c
@@ -3801,6 +3801,31 @@ build_function_type (value_type, arg_types)
return t;
}
+/* Like build_function_type, but take a vararg list of nodes. The
+ list of nodes should end with a NULL_TREE. This is typically used
+ for creating function types for builtins. */
+
+tree
+build_function_type_list VPARAMS ((tree first, ...))
+{
+ tree t, args, last;
+
+ VA_OPEN (p, first);
+ VA_FIXEDARG (p, tree, first);
+
+ t = va_arg (p, tree);
+ for (args = NULL_TREE; t != NULL_TREE; t = va_arg (p, tree))
+ args = tree_cons (NULL_TREE, t, args);
+
+ last = args;
+ args = nreverse (args);
+ TREE_CHAIN (last) = void_list_node;
+ args = build_function_type (first, args);
+
+ VA_CLOSE (p);
+ return args;
+}
+
/* Construct, lay out and return the type of methods belonging to class
BASETYPE and whose arguments and values are described by TYPE.
If that type exists already, reuse it.