Commit 6a4825bd by Nathan Froyd Committed by Nathan Froyd

tree.c (build_common_builtin_nodes): Use build_function_type_list instead of build_function_type.

	* tree.c (build_common_builtin_nodes): Use build_function_type_list
	instead of build_function_type.
	* tree-ssa-loop-prefetch.c (tree_ssa_prefetch_arrays): Likewise.
	* cgraphunit.c (cgraph_build_static_cdtor): Likewise.

From-SVN: r162264
parent c5af628d
2010-07-16 Nathan Froyd <froydnj@codesourcery.com> 2010-07-16 Nathan Froyd <froydnj@codesourcery.com>
* tree.c (build_common_builtin_nodes): Use build_function_type_list
instead of build_function_type.
* tree-ssa-loop-prefetch.c (tree_ssa_prefetch_arrays): Likewise.
* cgraphunit.c (cgraph_build_static_cdtor): Likewise.
2010-07-16 Nathan Froyd <froydnj@codesourcery.com>
* config/rs6000/rs6000.c (rs6000_emit_sISEL): Let rs6000_emit_int_cmove * config/rs6000/rs6000.c (rs6000_emit_sISEL): Let rs6000_emit_int_cmove
do all the work. do all the work.
(rs6000_emit_int_cmove): Use function pointers for insn generation. (rs6000_emit_int_cmove): Use function pointers for insn generation.
......
...@@ -2017,7 +2017,7 @@ cgraph_build_static_cdtor (char which, tree body, int priority) ...@@ -2017,7 +2017,7 @@ cgraph_build_static_cdtor (char which, tree body, int priority)
name = get_file_function_name (which_buf); name = get_file_function_name (which_buf);
decl = build_decl (input_location, FUNCTION_DECL, name, decl = build_decl (input_location, FUNCTION_DECL, name,
build_function_type (void_type_node, void_list_node)); build_function_type_list (void_type_node, NULL_TREE));
current_function_decl = decl; current_function_decl = decl;
resdecl = build_decl (input_location, resdecl = build_decl (input_location,
......
...@@ -1903,10 +1903,8 @@ tree_ssa_prefetch_arrays (void) ...@@ -1903,10 +1903,8 @@ tree_ssa_prefetch_arrays (void)
if (!built_in_decls[BUILT_IN_PREFETCH]) if (!built_in_decls[BUILT_IN_PREFETCH])
{ {
tree type = build_function_type (void_type_node, tree type = build_function_type_list (void_type_node,
tree_cons (NULL_TREE, const_ptr_type_node, NULL_TREE);
const_ptr_type_node,
NULL_TREE));
tree decl = add_builtin_function ("__builtin_prefetch", type, tree decl = add_builtin_function ("__builtin_prefetch", type,
BUILT_IN_PREFETCH, BUILT_IN_NORMAL, BUILT_IN_PREFETCH, BUILT_IN_NORMAL,
NULL, NULL_TREE); NULL, NULL_TREE);
......
...@@ -9149,15 +9149,14 @@ local_define_builtin (const char *name, tree type, enum built_in_function code, ...@@ -9149,15 +9149,14 @@ local_define_builtin (const char *name, tree type, enum built_in_function code,
void void
build_common_builtin_nodes (void) build_common_builtin_nodes (void)
{ {
tree tmp, tmp2, ftype; tree tmp, ftype;
if (built_in_decls[BUILT_IN_MEMCPY] == NULL if (built_in_decls[BUILT_IN_MEMCPY] == NULL
|| built_in_decls[BUILT_IN_MEMMOVE] == NULL) || built_in_decls[BUILT_IN_MEMMOVE] == NULL)
{ {
tmp = tree_cons (NULL_TREE, size_type_node, void_list_node); ftype = build_function_type_list (ptr_type_node,
tmp = tree_cons (NULL_TREE, const_ptr_type_node, tmp); ptr_type_node, const_ptr_type_node,
tmp = tree_cons (NULL_TREE, ptr_type_node, tmp); size_type_node, NULL_TREE);
ftype = build_function_type (ptr_type_node, tmp);
if (built_in_decls[BUILT_IN_MEMCPY] == NULL) if (built_in_decls[BUILT_IN_MEMCPY] == NULL)
local_define_builtin ("__builtin_memcpy", ftype, BUILT_IN_MEMCPY, local_define_builtin ("__builtin_memcpy", ftype, BUILT_IN_MEMCPY,
...@@ -9169,28 +9168,26 @@ build_common_builtin_nodes (void) ...@@ -9169,28 +9168,26 @@ build_common_builtin_nodes (void)
if (built_in_decls[BUILT_IN_MEMCMP] == NULL) if (built_in_decls[BUILT_IN_MEMCMP] == NULL)
{ {
tmp = tree_cons (NULL_TREE, size_type_node, void_list_node); ftype = build_function_type_list (integer_type_node, const_ptr_type_node,
tmp = tree_cons (NULL_TREE, const_ptr_type_node, tmp); const_ptr_type_node, size_type_node,
tmp = tree_cons (NULL_TREE, const_ptr_type_node, tmp); NULL_TREE);
ftype = build_function_type (integer_type_node, tmp);
local_define_builtin ("__builtin_memcmp", ftype, BUILT_IN_MEMCMP, local_define_builtin ("__builtin_memcmp", ftype, BUILT_IN_MEMCMP,
"memcmp", ECF_PURE | ECF_NOTHROW); "memcmp", ECF_PURE | ECF_NOTHROW);
} }
if (built_in_decls[BUILT_IN_MEMSET] == NULL) if (built_in_decls[BUILT_IN_MEMSET] == NULL)
{ {
tmp = tree_cons (NULL_TREE, size_type_node, void_list_node); ftype = build_function_type_list (ptr_type_node,
tmp = tree_cons (NULL_TREE, integer_type_node, tmp); ptr_type_node, integer_type_node,
tmp = tree_cons (NULL_TREE, ptr_type_node, tmp); size_type_node, NULL_TREE);
ftype = build_function_type (ptr_type_node, tmp);
local_define_builtin ("__builtin_memset", ftype, BUILT_IN_MEMSET, local_define_builtin ("__builtin_memset", ftype, BUILT_IN_MEMSET,
"memset", ECF_NOTHROW); "memset", ECF_NOTHROW);
} }
if (built_in_decls[BUILT_IN_ALLOCA] == NULL) if (built_in_decls[BUILT_IN_ALLOCA] == NULL)
{ {
tmp = tree_cons (NULL_TREE, size_type_node, void_list_node); ftype = build_function_type_list (ptr_type_node,
ftype = build_function_type (ptr_type_node, tmp); size_type_node, NULL_TREE);
local_define_builtin ("__builtin_alloca", ftype, BUILT_IN_ALLOCA, local_define_builtin ("__builtin_alloca", ftype, BUILT_IN_ALLOCA,
"alloca", ECF_MALLOC | ECF_NOTHROW); "alloca", ECF_MALLOC | ECF_NOTHROW);
} }
...@@ -9199,60 +9196,53 @@ build_common_builtin_nodes (void) ...@@ -9199,60 +9196,53 @@ build_common_builtin_nodes (void)
if (flag_stack_check) if (flag_stack_check)
TREE_NOTHROW (built_in_decls[BUILT_IN_ALLOCA]) = 0; TREE_NOTHROW (built_in_decls[BUILT_IN_ALLOCA]) = 0;
tmp = tree_cons (NULL_TREE, ptr_type_node, void_list_node); ftype = build_function_type_list (void_type_node,
tmp = tree_cons (NULL_TREE, ptr_type_node, tmp); ptr_type_node, ptr_type_node,
tmp = tree_cons (NULL_TREE, ptr_type_node, tmp); ptr_type_node, NULL_TREE);
ftype = build_function_type (void_type_node, tmp);
local_define_builtin ("__builtin_init_trampoline", ftype, local_define_builtin ("__builtin_init_trampoline", ftype,
BUILT_IN_INIT_TRAMPOLINE, BUILT_IN_INIT_TRAMPOLINE,
"__builtin_init_trampoline", ECF_NOTHROW); "__builtin_init_trampoline", ECF_NOTHROW);
tmp = tree_cons (NULL_TREE, ptr_type_node, void_list_node); ftype = build_function_type_list (ptr_type_node, ptr_type_node, NULL_TREE);
ftype = build_function_type (ptr_type_node, tmp);
local_define_builtin ("__builtin_adjust_trampoline", ftype, local_define_builtin ("__builtin_adjust_trampoline", ftype,
BUILT_IN_ADJUST_TRAMPOLINE, BUILT_IN_ADJUST_TRAMPOLINE,
"__builtin_adjust_trampoline", "__builtin_adjust_trampoline",
ECF_CONST | ECF_NOTHROW); ECF_CONST | ECF_NOTHROW);
tmp = tree_cons (NULL_TREE, ptr_type_node, void_list_node); ftype = build_function_type_list (void_type_node,
tmp = tree_cons (NULL_TREE, ptr_type_node, tmp); ptr_type_node, ptr_type_node, NULL_TREE);
ftype = build_function_type (void_type_node, tmp);
local_define_builtin ("__builtin_nonlocal_goto", ftype, local_define_builtin ("__builtin_nonlocal_goto", ftype,
BUILT_IN_NONLOCAL_GOTO, BUILT_IN_NONLOCAL_GOTO,
"__builtin_nonlocal_goto", "__builtin_nonlocal_goto",
ECF_NORETURN | ECF_NOTHROW); ECF_NORETURN | ECF_NOTHROW);
tmp = tree_cons (NULL_TREE, ptr_type_node, void_list_node); ftype = build_function_type_list (void_type_node,
tmp = tree_cons (NULL_TREE, ptr_type_node, tmp); ptr_type_node, ptr_type_node, NULL_TREE);
ftype = build_function_type (void_type_node, tmp);
local_define_builtin ("__builtin_setjmp_setup", ftype, local_define_builtin ("__builtin_setjmp_setup", ftype,
BUILT_IN_SETJMP_SETUP, BUILT_IN_SETJMP_SETUP,
"__builtin_setjmp_setup", ECF_NOTHROW); "__builtin_setjmp_setup", ECF_NOTHROW);
tmp = tree_cons (NULL_TREE, ptr_type_node, void_list_node); ftype = build_function_type_list (ptr_type_node, ptr_type_node, NULL_TREE);
ftype = build_function_type (ptr_type_node, tmp);
local_define_builtin ("__builtin_setjmp_dispatcher", ftype, local_define_builtin ("__builtin_setjmp_dispatcher", ftype,
BUILT_IN_SETJMP_DISPATCHER, BUILT_IN_SETJMP_DISPATCHER,
"__builtin_setjmp_dispatcher", "__builtin_setjmp_dispatcher",
ECF_PURE | ECF_NOTHROW); ECF_PURE | ECF_NOTHROW);
tmp = tree_cons (NULL_TREE, ptr_type_node, void_list_node); ftype = build_function_type_list (void_type_node, ptr_type_node, NULL_TREE);
ftype = build_function_type (void_type_node, tmp);
local_define_builtin ("__builtin_setjmp_receiver", ftype, local_define_builtin ("__builtin_setjmp_receiver", ftype,
BUILT_IN_SETJMP_RECEIVER, BUILT_IN_SETJMP_RECEIVER,
"__builtin_setjmp_receiver", ECF_NOTHROW); "__builtin_setjmp_receiver", ECF_NOTHROW);
ftype = build_function_type (ptr_type_node, void_list_node); ftype = build_function_type_list (ptr_type_node, NULL_TREE);
local_define_builtin ("__builtin_stack_save", ftype, BUILT_IN_STACK_SAVE, local_define_builtin ("__builtin_stack_save", ftype, BUILT_IN_STACK_SAVE,
"__builtin_stack_save", ECF_NOTHROW); "__builtin_stack_save", ECF_NOTHROW);
tmp = tree_cons (NULL_TREE, ptr_type_node, void_list_node); ftype = build_function_type_list (void_type_node, ptr_type_node, NULL_TREE);
ftype = build_function_type (void_type_node, tmp);
local_define_builtin ("__builtin_stack_restore", ftype, local_define_builtin ("__builtin_stack_restore", ftype,
BUILT_IN_STACK_RESTORE, BUILT_IN_STACK_RESTORE,
"__builtin_stack_restore", ECF_NOTHROW); "__builtin_stack_restore", ECF_NOTHROW);
ftype = build_function_type (void_type_node, void_list_node); ftype = build_function_type_list (void_type_node, NULL_TREE);
local_define_builtin ("__builtin_profile_func_enter", ftype, local_define_builtin ("__builtin_profile_func_enter", ftype,
BUILT_IN_PROFILE_FUNC_ENTER, "profile_func_enter", 0); BUILT_IN_PROFILE_FUNC_ENTER, "profile_func_enter", 0);
local_define_builtin ("__builtin_profile_func_exit", ftype, local_define_builtin ("__builtin_profile_func_exit", ftype,
...@@ -9262,14 +9252,13 @@ build_common_builtin_nodes (void) ...@@ -9262,14 +9252,13 @@ build_common_builtin_nodes (void)
alternate __cxa_end_cleanup node used to resume from C++ and Java. */ alternate __cxa_end_cleanup node used to resume from C++ and Java. */
if (targetm.arm_eabi_unwinder) if (targetm.arm_eabi_unwinder)
{ {
ftype = build_function_type (void_type_node, void_list_node); ftype = build_function_type_list (void_type_node, NULL_TREE);
local_define_builtin ("__builtin_cxa_end_cleanup", ftype, local_define_builtin ("__builtin_cxa_end_cleanup", ftype,
BUILT_IN_CXA_END_CLEANUP, BUILT_IN_CXA_END_CLEANUP,
"__cxa_end_cleanup", ECF_NORETURN); "__cxa_end_cleanup", ECF_NORETURN);
} }
tmp = tree_cons (NULL_TREE, ptr_type_node, void_list_node); ftype = build_function_type_list (void_type_node, ptr_type_node, NULL_TREE);
ftype = build_function_type (void_type_node, tmp);
local_define_builtin ("__builtin_unwind_resume", ftype, local_define_builtin ("__builtin_unwind_resume", ftype,
BUILT_IN_UNWIND_RESUME, BUILT_IN_UNWIND_RESUME,
(USING_SJLJ_EXCEPTIONS (USING_SJLJ_EXCEPTIONS
...@@ -9282,19 +9271,19 @@ build_common_builtin_nodes (void) ...@@ -9282,19 +9271,19 @@ build_common_builtin_nodes (void)
landing pad. These functions are PURE instead of CONST to prevent landing pad. These functions are PURE instead of CONST to prevent
them from being hoisted past the exception edge that will initialize them from being hoisted past the exception edge that will initialize
its value in the landing pad. */ its value in the landing pad. */
tmp = tree_cons (NULL_TREE, integer_type_node, void_list_node); ftype = build_function_type_list (ptr_type_node,
ftype = build_function_type (ptr_type_node, tmp); integer_type_node, NULL_TREE);
local_define_builtin ("__builtin_eh_pointer", ftype, BUILT_IN_EH_POINTER, local_define_builtin ("__builtin_eh_pointer", ftype, BUILT_IN_EH_POINTER,
"__builtin_eh_pointer", ECF_PURE | ECF_NOTHROW); "__builtin_eh_pointer", ECF_PURE | ECF_NOTHROW);
tmp2 = lang_hooks.types.type_for_mode (targetm.eh_return_filter_mode (), 0); tmp = lang_hooks.types.type_for_mode (targetm.eh_return_filter_mode (), 0);
ftype = build_function_type (tmp2, tmp); ftype = build_function_type_list (tmp, integer_type_node, NULL_TREE);
local_define_builtin ("__builtin_eh_filter", ftype, BUILT_IN_EH_FILTER, local_define_builtin ("__builtin_eh_filter", ftype, BUILT_IN_EH_FILTER,
"__builtin_eh_filter", ECF_PURE | ECF_NOTHROW); "__builtin_eh_filter", ECF_PURE | ECF_NOTHROW);
tmp = tree_cons (NULL_TREE, integer_type_node, void_list_node); ftype = build_function_type_list (void_type_node,
tmp = tree_cons (NULL_TREE, integer_type_node, tmp); integer_type_node, integer_type_node,
ftype = build_function_type (void_type_node, tmp); NULL_TREE);
local_define_builtin ("__builtin_eh_copy_values", ftype, local_define_builtin ("__builtin_eh_copy_values", ftype,
BUILT_IN_EH_COPY_VALUES, BUILT_IN_EH_COPY_VALUES,
"__builtin_eh_copy_values", ECF_NOTHROW); "__builtin_eh_copy_values", ECF_NOTHROW);
...@@ -9318,11 +9307,8 @@ build_common_builtin_nodes (void) ...@@ -9318,11 +9307,8 @@ build_common_builtin_nodes (void)
continue; continue;
inner_type = TREE_TYPE (type); inner_type = TREE_TYPE (type);
tmp = tree_cons (NULL_TREE, inner_type, void_list_node); ftype = build_function_type_list (type, inner_type, inner_type,
tmp = tree_cons (NULL_TREE, inner_type, tmp); inner_type, inner_type, NULL_TREE);
tmp = tree_cons (NULL_TREE, inner_type, tmp);
tmp = tree_cons (NULL_TREE, inner_type, tmp);
ftype = build_function_type (type, tmp);
mcode = ((enum built_in_function) mcode = ((enum built_in_function)
(BUILT_IN_COMPLEX_MUL_MIN + mode - MIN_MODE_COMPLEX_FLOAT)); (BUILT_IN_COMPLEX_MUL_MIN + mode - MIN_MODE_COMPLEX_FLOAT));
......
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