Commit b4de2f7d by Aldy Hernandez Committed by Aldy Hernandez

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
parent 1691051f
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.
2002-06-29 Kaveh R. Ghazi <ghazi@caip.rutgers.edu> 2002-06-29 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
* collect2.c (scan_prog_file): Fix typo in message. * collect2.c (scan_prog_file): Fix typo in message.
......
...@@ -6498,22 +6498,17 @@ alpha_init_builtins () ...@@ -6498,22 +6498,17 @@ alpha_init_builtins ()
if ((target_flags & p->target_mask) == p->target_mask) if ((target_flags & p->target_mask) == p->target_mask)
builtin_function (p->name, ftype, p->code, BUILT_IN_MD, NULL); builtin_function (p->name, ftype, p->code, BUILT_IN_MD, NULL);
ftype = build_function_type (long_integer_type_node, ftype = build_function_type_list (long_integer_type_node,
tree_cons (NULL_TREE, long_integer_type_node, NULL_TREE);
long_integer_type_node,
void_list_node));
p = one_arg_builtins; p = one_arg_builtins;
for (i = 0; i < ARRAY_SIZE (one_arg_builtins); ++i, ++p) for (i = 0; i < ARRAY_SIZE (one_arg_builtins); ++i, ++p)
if ((target_flags & p->target_mask) == p->target_mask) if ((target_flags & p->target_mask) == p->target_mask)
builtin_function (p->name, ftype, p->code, BUILT_IN_MD, NULL); builtin_function (p->name, ftype, p->code, BUILT_IN_MD, NULL);
ftype = build_function_type (long_integer_type_node, ftype = build_function_type_list (long_integer_type_node,
tree_cons (NULL_TREE, long_integer_type_node,
long_integer_type_node, long_integer_type_node, NULL_TREE);
tree_cons (NULL_TREE,
long_integer_type_node,
void_list_node)));
p = two_arg_builtins; p = two_arg_builtins;
for (i = 0; i < ARRAY_SIZE (two_arg_builtins); ++i, ++p) for (i = 0; i < ARRAY_SIZE (two_arg_builtins); ++i, ++p)
...@@ -6524,9 +6519,7 @@ alpha_init_builtins () ...@@ -6524,9 +6519,7 @@ alpha_init_builtins ()
builtin_function ("__builtin_thread_pointer", ftype, builtin_function ("__builtin_thread_pointer", ftype,
ALPHA_BUILTIN_THREAD_POINTER, BUILT_IN_MD, NULL); ALPHA_BUILTIN_THREAD_POINTER, BUILT_IN_MD, NULL);
ftype = build_function_type (void_type_node, tree_cons (NULL_TREE, ftype = build_function_type_list (void_type_node, ptr_type_node, NULL_TREE);
ptr_type_node,
void_list_node));
builtin_function ("__builtin_set_thread_pointer", ftype, builtin_function ("__builtin_set_thread_pointer", ftype,
ALPHA_BUILTIN_SET_THREAD_POINTER, BUILT_IN_MD, NULL); ALPHA_BUILTIN_SET_THREAD_POINTER, BUILT_IN_MD, NULL);
} }
......
...@@ -9314,10 +9314,9 @@ arm_init_builtins () ...@@ -9314,10 +9314,9 @@ arm_init_builtins ()
tree int_ftype_int, void_ftype_pchar; tree int_ftype_int, void_ftype_pchar;
/* void func (void *) */ /* void func (char *) */
void_ftype_pchar void_ftype_pchar
= build_function_type (void_type_node, = build_function_type_list (void_type_node, pchar_type_node, NULL_TREE);
tree_cons (NULL_TREE, pchar_type_node, endlink));
/* int func (int) */ /* int func (int) */
int_ftype_int int_ftype_int
......
...@@ -7506,52 +7506,40 @@ ia64_init_builtins () ...@@ -7506,52 +7506,40 @@ ia64_init_builtins ()
{ {
tree psi_type_node = build_pointer_type (integer_type_node); tree psi_type_node = build_pointer_type (integer_type_node);
tree pdi_type_node = build_pointer_type (long_integer_type_node); tree pdi_type_node = build_pointer_type (long_integer_type_node);
tree endlink = void_list_node;
/* __sync_val_compare_and_swap_si, __sync_bool_compare_and_swap_si */ /* __sync_val_compare_and_swap_si, __sync_bool_compare_and_swap_si */
tree si_ftype_psi_si_si tree si_ftype_psi_si_si
= build_function_type (integer_type_node, = build_function_type_list (integer_type_node,
tree_cons (NULL_TREE, psi_type_node, psi_type_node, integer_type_node,
tree_cons (NULL_TREE, integer_type_node, integer_type_node, NULL_TREE);
tree_cons (NULL_TREE,
integer_type_node,
endlink))));
/* __sync_val_compare_and_swap_di, __sync_bool_compare_and_swap_di */ /* __sync_val_compare_and_swap_di, __sync_bool_compare_and_swap_di */
tree di_ftype_pdi_di_di tree di_ftype_pdi_di_di
= build_function_type (long_integer_type_node, = build_function_type_list (long_integer_type_node,
tree_cons (NULL_TREE, pdi_type_node, pdi_type_node, long_integer_type_node,
tree_cons (NULL_TREE, long_integer_type_node, NULL_TREE);
long_integer_type_node,
tree_cons (NULL_TREE,
long_integer_type_node,
endlink))));
/* __sync_synchronize */ /* __sync_synchronize */
tree void_ftype_void tree void_ftype_void
= build_function_type (void_type_node, endlink); = build_function_type (void_type_node, void_list_node);
/* __sync_lock_test_and_set_si */ /* __sync_lock_test_and_set_si */
tree si_ftype_psi_si tree si_ftype_psi_si
= build_function_type (integer_type_node, = build_function_type_list (integer_type_node,
tree_cons (NULL_TREE, psi_type_node, psi_type_node, integer_type_node, NULL_TREE);
tree_cons (NULL_TREE, integer_type_node, endlink)));
/* __sync_lock_test_and_set_di */ /* __sync_lock_test_and_set_di */
tree di_ftype_pdi_di tree di_ftype_pdi_di
= build_function_type (long_integer_type_node, = build_function_type_list (long_integer_type_node,
tree_cons (NULL_TREE, pdi_type_node, pdi_type_node, long_integer_type_node,
tree_cons (NULL_TREE, long_integer_type_node, NULL_TREE);
endlink)));
/* __sync_lock_release_si */ /* __sync_lock_release_si */
tree void_ftype_psi tree void_ftype_psi
= build_function_type (void_type_node, tree_cons (NULL_TREE, psi_type_node, = build_function_type_list (void_type_node, psi_type_node, NULL_TREE);
endlink));
/* __sync_lock_release_di */ /* __sync_lock_release_di */
tree void_ftype_pdi tree void_ftype_pdi
= build_function_type (void_type_node, tree_cons (NULL_TREE, pdi_type_node, = build_function_type_list (void_type_node, pdi_type_node, NULL_TREE);
endlink));
#define def_builtin(name, type, code) \ #define def_builtin(name, type, code) \
builtin_function ((name), (type), (code), BUILT_IN_MD, NULL) builtin_function ((name), (type), (code), BUILT_IN_MD, NULL)
...@@ -7578,11 +7566,11 @@ ia64_init_builtins () ...@@ -7578,11 +7566,11 @@ ia64_init_builtins ()
IA64_BUILTIN_LOCK_RELEASE_DI); IA64_BUILTIN_LOCK_RELEASE_DI);
def_builtin ("__builtin_ia64_bsp", def_builtin ("__builtin_ia64_bsp",
build_function_type (ptr_type_node, endlink), build_function_type (ptr_type_node, void_list_node),
IA64_BUILTIN_BSP); IA64_BUILTIN_BSP);
def_builtin ("__builtin_ia64_flushrs", def_builtin ("__builtin_ia64_flushrs",
build_function_type (void_type_node, endlink), build_function_type (void_type_node, void_list_node),
IA64_BUILTIN_FLUSHRS); IA64_BUILTIN_FLUSHRS);
def_builtin ("__sync_fetch_and_add_si", si_ftype_psi_si, def_builtin ("__sync_fetch_and_add_si", si_ftype_psi_si,
......
...@@ -3801,6 +3801,31 @@ build_function_type (value_type, arg_types) ...@@ -3801,6 +3801,31 @@ build_function_type (value_type, arg_types)
return t; 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 /* Construct, lay out and return the type of methods belonging to class
BASETYPE and whose arguments and values are described by TYPE. BASETYPE and whose arguments and values are described by TYPE.
If that type exists already, reuse it. If that type exists already, reuse it.
......
...@@ -2178,6 +2178,7 @@ extern tree build_index_type PARAMS ((tree)); ...@@ -2178,6 +2178,7 @@ extern tree build_index_type PARAMS ((tree));
extern tree build_index_2_type PARAMS ((tree, tree)); extern tree build_index_2_type PARAMS ((tree, tree));
extern tree build_array_type PARAMS ((tree, tree)); extern tree build_array_type PARAMS ((tree, tree));
extern tree build_function_type PARAMS ((tree, tree)); extern tree build_function_type PARAMS ((tree, tree));
extern tree build_function_type_list PARAMS ((tree, ...));
extern tree build_method_type PARAMS ((tree, tree)); extern tree build_method_type PARAMS ((tree, tree));
extern tree build_offset_type PARAMS ((tree, tree)); extern tree build_offset_type PARAMS ((tree, tree));
extern tree build_complex_type PARAMS ((tree)); extern tree build_complex_type PARAMS ((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