Commit 9dc1704f by Nathan Froyd Committed by Nathan Froyd

decl.c (java_init_decl_processing): Use build_function_type_list instead of build_function_type.

	* decl.c (java_init_decl_processing): Use build_function_type_list
	instead of build_function_type.
	* jcf-parse.c (java_emit_static_constructor): Likewise.
	* builtins.c (initialize_builtins): Likewise.

From-SVN: r165317
parent 1928f450
2010-10-11 Nathan Froyd <froydnj@codesourcery.com>
* decl.c (java_init_decl_processing): Use build_function_type_list
instead of build_function_type.
* jcf-parse.c (java_emit_static_constructor): Likewise.
* builtins.c (initialize_builtins): Likewise.
2010-10-08 Joseph Myers <joseph@codesourcery.com> 2010-10-08 Joseph Myers <joseph@codesourcery.com>
* lang.c (java_init_options_struct): New. Split out from * lang.c (java_init_options_struct): New. Split out from
......
...@@ -498,7 +498,6 @@ initialize_builtins (void) ...@@ -498,7 +498,6 @@ initialize_builtins (void)
tree double_ftype_double, double_ftype_double_double; tree double_ftype_double, double_ftype_double_double;
tree float_ftype_float_float; tree float_ftype_float_float;
tree boolean_ftype_boolean_boolean; tree boolean_ftype_boolean_boolean;
tree t;
int i; int i;
for (i = 0; java_builtins[i].builtin_code != END_BUILTINS; ++i) for (i = 0; java_builtins[i].builtin_code != END_BUILTINS; ++i)
...@@ -512,14 +511,15 @@ initialize_builtins (void) ...@@ -512,14 +511,15 @@ initialize_builtins (void)
void_list_node = end_params_node; void_list_node = end_params_node;
t = tree_cons (NULL_TREE, float_type_node, end_params_node); float_ftype_float_float
t = tree_cons (NULL_TREE, float_type_node, t); = build_function_type_list (float_type_node,
float_ftype_float_float = build_function_type (float_type_node, t); float_type_node, float_type_node, NULL_TREE);
t = tree_cons (NULL_TREE, double_type_node, end_params_node); double_ftype_double
double_ftype_double = build_function_type (double_type_node, t); = build_function_type_list (double_type_node, double_type_node, NULL_TREE);
t = tree_cons (NULL_TREE, double_type_node, t); double_ftype_double_double
double_ftype_double_double = build_function_type (double_type_node, t); = build_function_type_list (double_type_node,
double_type_node, double_type_node, NULL_TREE);
define_builtin (BUILT_IN_FMOD, "__builtin_fmod", define_builtin (BUILT_IN_FMOD, "__builtin_fmod",
double_ftype_double_double, "fmod", BUILTIN_CONST); double_ftype_double_double, "fmod", BUILTIN_CONST);
...@@ -566,9 +566,10 @@ initialize_builtins (void) ...@@ -566,9 +566,10 @@ initialize_builtins (void)
double_ftype_double, "_ZN4java4lang4Math3tanEJdd", double_ftype_double, "_ZN4java4lang4Math3tanEJdd",
BUILTIN_CONST); BUILTIN_CONST);
t = tree_cons (NULL_TREE, boolean_type_node, end_params_node); boolean_ftype_boolean_boolean
t = tree_cons (NULL_TREE, boolean_type_node, t); = build_function_type_list (boolean_type_node,
boolean_ftype_boolean_boolean = build_function_type (boolean_type_node, t); boolean_type_node, boolean_type_node,
NULL_TREE);
define_builtin (BUILT_IN_EXPECT, "__builtin_expect", define_builtin (BUILT_IN_EXPECT, "__builtin_expect",
boolean_ftype_boolean_boolean, boolean_ftype_boolean_boolean,
"__builtin_expect", "__builtin_expect",
...@@ -588,7 +589,7 @@ initialize_builtins (void) ...@@ -588,7 +589,7 @@ initialize_builtins (void)
int_type_node, NULL_TREE), int_type_node, NULL_TREE),
"__sync_bool_compare_and_swap_8", 0); "__sync_bool_compare_and_swap_8", 0);
define_builtin (BUILT_IN_SYNCHRONIZE, "__sync_synchronize", define_builtin (BUILT_IN_SYNCHRONIZE, "__sync_synchronize",
build_function_type (void_type_node, void_list_node), build_function_type_list (void_type_node, NULL_TREE),
"__sync_synchronize", BUILTIN_NOTHROW); "__sync_synchronize", BUILTIN_NOTHROW);
define_builtin (BUILT_IN_RETURN_ADDRESS, "__builtin_return_address", define_builtin (BUILT_IN_RETURN_ADDRESS, "__builtin_return_address",
......
...@@ -555,7 +555,6 @@ parse_version (void) ...@@ -555,7 +555,6 @@ parse_version (void)
void void
java_init_decl_processing (void) java_init_decl_processing (void)
{ {
tree endlink;
tree field = NULL_TREE; tree field = NULL_TREE;
tree t; tree t;
...@@ -987,40 +986,35 @@ java_init_decl_processing (void) ...@@ -987,40 +986,35 @@ java_init_decl_processing (void)
build_decl (BUILTINS_LOCATION, build_decl (BUILTINS_LOCATION,
TYPE_DECL, get_identifier ("Method"), method_type_node); TYPE_DECL, get_identifier ("Method"), method_type_node);
endlink = end_params_node = tree_cons (NULL_TREE, void_type_node, NULL_TREE); end_params_node = tree_cons (NULL_TREE, void_type_node, NULL_TREE);
t = tree_cons (NULL_TREE, class_ptr_type, endlink); t = build_function_type_list (ptr_type_node, class_ptr_type, NULL_TREE);
alloc_object_node = add_builtin_function ("_Jv_AllocObject", alloc_object_node = add_builtin_function ("_Jv_AllocObject", t,
build_function_type (ptr_type_node, t),
0, NOT_BUILT_IN, NULL, NULL_TREE); 0, NOT_BUILT_IN, NULL, NULL_TREE);
DECL_IS_MALLOC (alloc_object_node) = 1; DECL_IS_MALLOC (alloc_object_node) = 1;
alloc_no_finalizer_node = alloc_no_finalizer_node =
add_builtin_function ("_Jv_AllocObjectNoFinalizer", add_builtin_function ("_Jv_AllocObjectNoFinalizer", t,
build_function_type (ptr_type_node, t),
0, NOT_BUILT_IN, NULL, NULL_TREE); 0, NOT_BUILT_IN, NULL, NULL_TREE);
DECL_IS_MALLOC (alloc_no_finalizer_node) = 1; DECL_IS_MALLOC (alloc_no_finalizer_node) = 1;
t = tree_cons (NULL_TREE, ptr_type_node, endlink); t = build_function_type_list (void_type_node, ptr_type_node, NULL_TREE);
soft_initclass_node = add_builtin_function ("_Jv_InitClass", soft_initclass_node = add_builtin_function ("_Jv_InitClass", t,
build_function_type (void_type_node,
t),
0, NOT_BUILT_IN, NULL, NULL_TREE); 0, NOT_BUILT_IN, NULL, NULL_TREE);
t = tree_cons (NULL_TREE, class_ptr_type, t = build_function_type_list (ptr_type_node,
tree_cons (NULL_TREE, int_type_node, endlink)); class_ptr_type, int_type_node, NULL_TREE);
soft_resolvepoolentry_node soft_resolvepoolentry_node
= add_builtin_function ("_Jv_ResolvePoolEntry", = add_builtin_function ("_Jv_ResolvePoolEntry", t,
build_function_type (ptr_type_node, t),
0,NOT_BUILT_IN, NULL, NULL_TREE); 0,NOT_BUILT_IN, NULL, NULL_TREE);
DECL_PURE_P (soft_resolvepoolentry_node) = 1; DECL_PURE_P (soft_resolvepoolentry_node) = 1;
throw_node = add_builtin_function ("_Jv_Throw", t = build_function_type_list (void_type_node,
build_function_type (void_type_node, t), class_ptr_type, int_type_node, NULL_TREE);
throw_node = add_builtin_function ("_Jv_Throw", t,
0, NOT_BUILT_IN, NULL, NULL_TREE); 0, NOT_BUILT_IN, NULL, NULL_TREE);
/* Mark throw_nodes as `noreturn' functions with side effects. */ /* Mark throw_nodes as `noreturn' functions with side effects. */
TREE_THIS_VOLATILE (throw_node) = 1; TREE_THIS_VOLATILE (throw_node) = 1;
TREE_SIDE_EFFECTS (throw_node) = 1; TREE_SIDE_EFFECTS (throw_node) = 1;
t = build_function_type (void_type_node, tree_cons (NULL_TREE, ptr_type_node, t = build_function_type_list (void_type_node, ptr_type_node, NULL_TREE);
endlink));
soft_monitorenter_node soft_monitorenter_node
= add_builtin_function ("_Jv_MonitorEnter", t, 0, NOT_BUILT_IN, = add_builtin_function ("_Jv_MonitorEnter", t, 0, NOT_BUILT_IN,
NULL, NULL_TREE); NULL, NULL_TREE);
...@@ -1028,36 +1022,30 @@ java_init_decl_processing (void) ...@@ -1028,36 +1022,30 @@ java_init_decl_processing (void)
= add_builtin_function ("_Jv_MonitorExit", t, 0, NOT_BUILT_IN, = add_builtin_function ("_Jv_MonitorExit", t, 0, NOT_BUILT_IN,
NULL, NULL_TREE); NULL, NULL_TREE);
t = tree_cons (NULL_TREE, ptr_type_node, t = build_function_type_list (ptr_type_node,
tree_cons (NULL_TREE, int_type_node, endlink)); ptr_type_node, int_type_node, NULL_TREE);
soft_newarray_node soft_newarray_node
= add_builtin_function ("_Jv_NewPrimArray", = add_builtin_function ("_Jv_NewPrimArray", t,
build_function_type (ptr_type_node, t),
0, NOT_BUILT_IN, NULL, NULL_TREE); 0, NOT_BUILT_IN, NULL, NULL_TREE);
DECL_IS_MALLOC (soft_newarray_node) = 1; DECL_IS_MALLOC (soft_newarray_node) = 1;
t = tree_cons (NULL_TREE, int_type_node, t = build_function_type_list (ptr_type_node,
tree_cons (NULL_TREE, class_ptr_type, int_type_node, class_ptr_type,
tree_cons (NULL_TREE, object_ptr_type_node, object_ptr_type_node, NULL_TREE);
endlink)));
soft_anewarray_node soft_anewarray_node
= add_builtin_function ("_Jv_NewObjectArray", = add_builtin_function ("_Jv_NewObjectArray", t,
build_function_type (ptr_type_node, t),
0, NOT_BUILT_IN, NULL, NULL_TREE); 0, NOT_BUILT_IN, NULL, NULL_TREE);
DECL_IS_MALLOC (soft_anewarray_node) = 1; DECL_IS_MALLOC (soft_anewarray_node) = 1;
/* There is no endlink here because _Jv_NewMultiArray is a varargs t = build_varargs_function_type_list (ptr_type_node,
function. */ ptr_type_node, int_type_node,
t = tree_cons (NULL_TREE, ptr_type_node, NULL_TREE);
tree_cons (NULL_TREE, int_type_node, NULL_TREE));
soft_multianewarray_node soft_multianewarray_node
= add_builtin_function ("_Jv_NewMultiArray", = add_builtin_function ("_Jv_NewMultiArray", t,
build_function_type (ptr_type_node, t),
0, NOT_BUILT_IN, NULL, NULL_TREE); 0, NOT_BUILT_IN, NULL, NULL_TREE);
DECL_IS_MALLOC (soft_multianewarray_node) = 1; DECL_IS_MALLOC (soft_multianewarray_node) = 1;
t = build_function_type (void_type_node, t = build_function_type_list (void_type_node, int_type_node, NULL_TREE);
tree_cons (NULL_TREE, int_type_node, endlink));
soft_badarrayindex_node soft_badarrayindex_node
= add_builtin_function ("_Jv_ThrowBadArrayIndex", t, = add_builtin_function ("_Jv_ThrowBadArrayIndex", t,
0, NOT_BUILT_IN, NULL, NULL_TREE); 0, NOT_BUILT_IN, NULL, NULL_TREE);
...@@ -1066,9 +1054,9 @@ java_init_decl_processing (void) ...@@ -1066,9 +1054,9 @@ java_init_decl_processing (void)
TREE_THIS_VOLATILE (soft_badarrayindex_node) = 1; TREE_THIS_VOLATILE (soft_badarrayindex_node) = 1;
TREE_SIDE_EFFECTS (soft_badarrayindex_node) = 1; TREE_SIDE_EFFECTS (soft_badarrayindex_node) = 1;
t = build_function_type_list (void_type_node, NULL_TREE);
soft_nullpointer_node soft_nullpointer_node
= add_builtin_function ("_Jv_ThrowNullPointerException", = add_builtin_function ("_Jv_ThrowNullPointerException", t,
build_function_type (void_type_node, endlink),
0, NOT_BUILT_IN, NULL, NULL_TREE); 0, NOT_BUILT_IN, NULL, NULL_TREE);
/* Mark soft_nullpointer_node as a `noreturn' function with side /* Mark soft_nullpointer_node as a `noreturn' function with side
effects. */ effects. */
...@@ -1076,8 +1064,7 @@ java_init_decl_processing (void) ...@@ -1076,8 +1064,7 @@ java_init_decl_processing (void)
TREE_SIDE_EFFECTS (soft_nullpointer_node) = 1; TREE_SIDE_EFFECTS (soft_nullpointer_node) = 1;
soft_abstractmethod_node soft_abstractmethod_node
= add_builtin_function ("_Jv_ThrowAbstractMethodError", = add_builtin_function ("_Jv_ThrowAbstractMethodError", t,
build_function_type (void_type_node, endlink),
0, NOT_BUILT_IN, NULL, NULL_TREE); 0, NOT_BUILT_IN, NULL, NULL_TREE);
/* Mark soft_abstractmethod_node as a `noreturn' function with side /* Mark soft_abstractmethod_node as a `noreturn' function with side
effects. */ effects. */
...@@ -1085,95 +1072,85 @@ java_init_decl_processing (void) ...@@ -1085,95 +1072,85 @@ java_init_decl_processing (void)
TREE_SIDE_EFFECTS (soft_abstractmethod_node) = 1; TREE_SIDE_EFFECTS (soft_abstractmethod_node) = 1;
soft_nosuchfield_node soft_nosuchfield_node
= add_builtin_function ("_Jv_ThrowNoSuchFieldError", = add_builtin_function ("_Jv_ThrowNoSuchFieldError", t,
build_function_type (void_type_node, endlink),
0, NOT_BUILT_IN, NULL, NULL_TREE); 0, NOT_BUILT_IN, NULL, NULL_TREE);
/* Mark soft_nosuchfield_node as a `noreturn' function with side /* Mark soft_nosuchfield_node as a `noreturn' function with side
effects. */ effects. */
TREE_THIS_VOLATILE (soft_nosuchfield_node) = 1; TREE_THIS_VOLATILE (soft_nosuchfield_node) = 1;
TREE_SIDE_EFFECTS (soft_nosuchfield_node) = 1; TREE_SIDE_EFFECTS (soft_nosuchfield_node) = 1;
t = tree_cons (NULL_TREE, class_ptr_type, t = build_function_type_list (ptr_type_node,
tree_cons (NULL_TREE, object_ptr_type_node, endlink)); class_ptr_type, object_ptr_type_node,
NULL_TREE);
soft_checkcast_node soft_checkcast_node
= add_builtin_function ("_Jv_CheckCast", = add_builtin_function ("_Jv_CheckCast", t,
build_function_type (ptr_type_node, t),
0, NOT_BUILT_IN, NULL, NULL_TREE); 0, NOT_BUILT_IN, NULL, NULL_TREE);
t = tree_cons (NULL_TREE, object_ptr_type_node, t = build_function_type_list (boolean_type_node,
tree_cons (NULL_TREE, class_ptr_type, endlink)); object_ptr_type_node, class_ptr_type,
NULL_TREE);
soft_instanceof_node soft_instanceof_node
= add_builtin_function ("_Jv_IsInstanceOf", = add_builtin_function ("_Jv_IsInstanceOf", t,
build_function_type (boolean_type_node, t),
0, NOT_BUILT_IN, NULL, NULL_TREE); 0, NOT_BUILT_IN, NULL, NULL_TREE);
DECL_PURE_P (soft_instanceof_node) = 1; DECL_PURE_P (soft_instanceof_node) = 1;
t = tree_cons (NULL_TREE, object_ptr_type_node, t = build_function_type_list (void_type_node,
tree_cons (NULL_TREE, object_ptr_type_node, endlink)); object_ptr_type_node, object_ptr_type_node,
NULL_TREE);
soft_checkarraystore_node soft_checkarraystore_node
= add_builtin_function ("_Jv_CheckArrayStore", = add_builtin_function ("_Jv_CheckArrayStore", t,
build_function_type (void_type_node, t),
0, NOT_BUILT_IN, NULL, NULL_TREE); 0, NOT_BUILT_IN, NULL, NULL_TREE);
t = tree_cons (NULL_TREE, ptr_type_node, t = build_function_type_list (ptr_type_node,
tree_cons (NULL_TREE, ptr_type_node, ptr_type_node, ptr_type_node, int_type_node,
tree_cons (NULL_TREE, int_type_node, endlink))); NULL_TREE);
soft_lookupinterfacemethod_node soft_lookupinterfacemethod_node
= add_builtin_function ("_Jv_LookupInterfaceMethodIdx", = add_builtin_function ("_Jv_LookupInterfaceMethodIdx", t,
build_function_type (ptr_type_node, t),
0, NOT_BUILT_IN, NULL, NULL_TREE); 0, NOT_BUILT_IN, NULL, NULL_TREE);
DECL_PURE_P (soft_lookupinterfacemethod_node) = 1; DECL_PURE_P (soft_lookupinterfacemethod_node) = 1;
t = tree_cons (NULL_TREE, ptr_type_node,
tree_cons (NULL_TREE, ptr_type_node, t = build_function_type_list (ptr_type_node,
tree_cons (NULL_TREE, ptr_type_node, endlink))); ptr_type_node, ptr_type_node, ptr_type_node,
NULL_TREE);
soft_lookupinterfacemethodbyname_node soft_lookupinterfacemethodbyname_node
= add_builtin_function ("_Jv_LookupInterfaceMethod", = add_builtin_function ("_Jv_LookupInterfaceMethod", t,
build_function_type (ptr_type_node, t),
0, NOT_BUILT_IN, NULL, NULL_TREE); 0, NOT_BUILT_IN, NULL, NULL_TREE);
t = tree_cons (NULL_TREE, object_ptr_type_node, t = build_function_type_list (ptr_type_node,
tree_cons (NULL_TREE, ptr_type_node, object_ptr_type_node, ptr_type_node,
tree_cons (NULL_TREE, ptr_type_node, ptr_type_node, int_type_node, NULL_TREE);
tree_cons (NULL_TREE, int_type_node,
endlink))));
soft_lookupjnimethod_node soft_lookupjnimethod_node
= add_builtin_function ("_Jv_LookupJNIMethod", = add_builtin_function ("_Jv_LookupJNIMethod", t,
build_function_type (ptr_type_node, t),
0, NOT_BUILT_IN, NULL, NULL_TREE); 0, NOT_BUILT_IN, NULL, NULL_TREE);
t = tree_cons (NULL_TREE, ptr_type_node, endlink); t = build_function_type_list (ptr_type_node, ptr_type_node, NULL_TREE);
soft_getjnienvnewframe_node soft_getjnienvnewframe_node
= add_builtin_function ("_Jv_GetJNIEnvNewFrame", = add_builtin_function ("_Jv_GetJNIEnvNewFrame", t,
build_function_type (ptr_type_node, t),
0, NOT_BUILT_IN, NULL, NULL_TREE); 0, NOT_BUILT_IN, NULL, NULL_TREE);
t = build_function_type_list (void_type_node, ptr_type_node, NULL_TREE);
soft_jnipopsystemframe_node soft_jnipopsystemframe_node
= add_builtin_function ("_Jv_JNI_PopSystemFrame", = add_builtin_function ("_Jv_JNI_PopSystemFrame", t,
build_function_type (void_type_node, t),
0, NOT_BUILT_IN, NULL, NULL_TREE); 0, NOT_BUILT_IN, NULL, NULL_TREE);
t = tree_cons (NULL_TREE, object_ptr_type_node, endlink); t = build_function_type_list (object_ptr_type_node,
object_ptr_type_node, NULL_TREE);
soft_unwrapjni_node soft_unwrapjni_node
= add_builtin_function ("_Jv_UnwrapJNIweakReference", = add_builtin_function ("_Jv_UnwrapJNIweakReference", t,
build_function_type (object_ptr_type_node, t),
0, NOT_BUILT_IN, NULL, NULL_TREE); 0, NOT_BUILT_IN, NULL, NULL_TREE);
t = tree_cons (NULL_TREE, int_type_node, t = build_function_type_list (int_type_node,
tree_cons (NULL_TREE, int_type_node, endlink)); int_type_node, int_type_node, NULL_TREE);
soft_idiv_node soft_idiv_node
= add_builtin_function ("_Jv_divI", = add_builtin_function ("_Jv_divI", t,
build_function_type (int_type_node, t),
0, NOT_BUILT_IN, NULL, NULL_TREE); 0, NOT_BUILT_IN, NULL, NULL_TREE);
soft_irem_node soft_irem_node
= add_builtin_function ("_Jv_remI", = add_builtin_function ("_Jv_remI", t,
build_function_type (int_type_node, t),
0, NOT_BUILT_IN, NULL, NULL_TREE); 0, NOT_BUILT_IN, NULL, NULL_TREE);
t = tree_cons (NULL_TREE, long_type_node, t = build_function_type_list (long_type_node,
tree_cons (NULL_TREE, long_type_node, endlink)); long_type_node, long_type_node, NULL_TREE);
soft_ldiv_node soft_ldiv_node
= add_builtin_function ("_Jv_divJ", = add_builtin_function ("_Jv_divJ", t,
build_function_type (long_type_node, t),
0, NOT_BUILT_IN, NULL, NULL_TREE); 0, NOT_BUILT_IN, NULL, NULL_TREE);
soft_lrem_node soft_lrem_node
= add_builtin_function ("_Jv_remJ", = add_builtin_function ("_Jv_remJ", t,
build_function_type (long_type_node, t),
0, NOT_BUILT_IN, NULL, NULL_TREE); 0, NOT_BUILT_IN, NULL, NULL_TREE);
initialize_builtins (); initialize_builtins ();
......
...@@ -1704,7 +1704,7 @@ java_emit_static_constructor (void) ...@@ -1704,7 +1704,7 @@ java_emit_static_constructor (void)
tree decl tree decl
= build_decl (input_location, FUNCTION_DECL, name, = 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));
tree resdecl = build_decl (input_location, tree resdecl = build_decl (input_location,
RESULT_DECL, NULL_TREE, void_type_node); RESULT_DECL, NULL_TREE, void_type_node);
......
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