Commit 94cdeb1a by Roger Sayle Committed by Roger Sayle

builtins.c (max_builtin, [...]): Replace calls to build with buildN.


	* builtins.c (max_builtin, min_builtin,
	java_build_function_call_expr): Replace calls to build with buildN.
	* class.c (build_class_ref, build_static_field_ref,
	get_dispatch_table, make_class_data, layout_class_method): Likewise.
	* constants.c (build_ref_from_constant_pool): Likewise.
	* decl.c (update_aliases, push_jvm_slot, poplevel, finish_method,
	add_stmt_to_compound): Likewise.
	* except.c (build_exception_object_ref, expand_end_java_handler):
	Likewise.
	* java-gimplify.c (java_gimplify_case_expr,
	java_gimplify_default_expr, java_gimplify_block,
	java_gimplify_new_array_init, java_gimplify_try_expr): Likewise.
	* jcf-write.c (generate_bytecode_insns): Likewise.
	* typeck.c (convert_ieee_real_to_integer): Likewise.

From-SVN: r84894
parent 3d23e018
2004-07-18 Roger Sayle <roger@eyesopen.com>
* builtins.c (max_builtin, min_builtin,
java_build_function_call_expr): Replace calls to build with buildN.
* class.c (build_class_ref, build_static_field_ref,
get_dispatch_table, make_class_data, layout_class_method): Likewise.
* constants.c (build_ref_from_constant_pool): Likewise.
* decl.c (update_aliases, push_jvm_slot, poplevel, finish_method,
add_stmt_to_compound): Likewise.
* except.c (build_exception_object_ref, expand_end_java_handler):
Likewise.
* java-gimplify.c (java_gimplify_case_expr,
java_gimplify_default_expr, java_gimplify_block,
java_gimplify_new_array_init, java_gimplify_try_expr): Likewise.
* jcf-write.c (generate_bytecode_insns): Likewise.
* typeck.c (convert_ieee_real_to_integer): Likewise.
2004-07-17 Joseph S. Myers <jsm@polyomino.org.uk> 2004-07-17 Joseph S. Myers <jsm@polyomino.org.uk>
* java-tree.h (builtin_function): Declare. * java-tree.h (builtin_function): Declare.
......
...@@ -96,17 +96,17 @@ static GTY(()) struct builtin_record java_builtins[] = ...@@ -96,17 +96,17 @@ static GTY(()) struct builtin_record java_builtins[] =
static tree static tree
max_builtin (tree method_return_type, tree method_arguments) max_builtin (tree method_return_type, tree method_arguments)
{ {
return fold (build (MAX_EXPR, method_return_type, return fold (build2 (MAX_EXPR, method_return_type,
TREE_VALUE (method_arguments), TREE_VALUE (method_arguments),
TREE_VALUE (TREE_CHAIN (method_arguments)))); TREE_VALUE (TREE_CHAIN (method_arguments))));
} }
static tree static tree
min_builtin (tree method_return_type, tree method_arguments) min_builtin (tree method_return_type, tree method_arguments)
{ {
return fold (build (MIN_EXPR, method_return_type, return fold (build2 (MIN_EXPR, method_return_type,
TREE_VALUE (method_arguments), TREE_VALUE (method_arguments),
TREE_VALUE (TREE_CHAIN (method_arguments)))); TREE_VALUE (TREE_CHAIN (method_arguments))));
} }
static tree static tree
...@@ -123,8 +123,8 @@ java_build_function_call_expr (tree fn, tree arglist) ...@@ -123,8 +123,8 @@ java_build_function_call_expr (tree fn, tree arglist)
tree call_expr; tree call_expr;
call_expr = build1 (ADDR_EXPR, build_pointer_type (TREE_TYPE (fn)), fn); call_expr = build1 (ADDR_EXPR, build_pointer_type (TREE_TYPE (fn)), fn);
call_expr = build (CALL_EXPR, TREE_TYPE (TREE_TYPE (fn)), call_expr = build3 (CALL_EXPR, TREE_TYPE (TREE_TYPE (fn)),
call_expr, arglist, NULL_TREE); call_expr, arglist, NULL_TREE);
TREE_SIDE_EFFECTS (call_expr) = 1; TREE_SIDE_EFFECTS (call_expr) = 1;
return fold (call_expr); return fold (call_expr);
} }
......
...@@ -1050,8 +1050,8 @@ build_class_ref (tree type) ...@@ -1050,8 +1050,8 @@ build_class_ref (tree type)
abort (); abort ();
prim_class = lookup_class (get_identifier (prim_class_name)); prim_class = lookup_class (get_identifier (prim_class_name));
return build (COMPONENT_REF, NULL_TREE, return build3 (COMPONENT_REF, NULL_TREE,
prim_class, TYPE_identifier_node, NULL_TREE); prim_class, TYPE_identifier_node, NULL_TREE);
} }
decl_name = TYPE_NAME (type); decl_name = TYPE_NAME (type);
if (TREE_CODE (decl_name) == TYPE_DECL) if (TREE_CODE (decl_name) == TYPE_DECL)
...@@ -1115,9 +1115,9 @@ build_static_field_ref (tree fdecl) ...@@ -1115,9 +1115,9 @@ build_static_field_ref (tree fdecl)
= build_int_2 (get_symbol_table_index = build_int_2 (get_symbol_table_index
(fdecl, &TYPE_ATABLE_METHODS (output_class)), 0); (fdecl, &TYPE_ATABLE_METHODS (output_class)), 0);
tree field_address tree field_address
= build (ARRAY_REF, build_pointer_type (TREE_TYPE (fdecl)), = build4 (ARRAY_REF, build_pointer_type (TREE_TYPE (fdecl)),
TYPE_ATABLE_DECL (output_class), table_index, TYPE_ATABLE_DECL (output_class), table_index,
NULL_TREE, NULL_TREE); NULL_TREE, NULL_TREE);
return fold (build1 (INDIRECT_REF, TREE_TYPE (fdecl), return fold (build1 (INDIRECT_REF, TREE_TYPE (fdecl),
field_address)); field_address));
} }
...@@ -1129,9 +1129,9 @@ build_static_field_ref (tree fdecl) ...@@ -1129,9 +1129,9 @@ build_static_field_ref (tree fdecl)
tree fld; tree fld;
int field_index = 0; int field_index = 0;
ref = build1 (INDIRECT_REF, class_type_node, ref); ref = build1 (INDIRECT_REF, class_type_node, ref);
ref = build (COMPONENT_REF, field_ptr_type_node, ref, ref = build3 (COMPONENT_REF, field_ptr_type_node, ref,
lookup_field (&class_type_node, fields_ident), lookup_field (&class_type_node, fields_ident),
NULL_TREE); NULL_TREE);
for (fld = TYPE_FIELDS (fclass); ; fld = TREE_CHAIN (fld)) for (fld = TYPE_FIELDS (fclass); ; fld = TREE_CHAIN (fld))
{ {
...@@ -1144,15 +1144,15 @@ build_static_field_ref (tree fdecl) ...@@ -1144,15 +1144,15 @@ build_static_field_ref (tree fdecl)
field_index++; field_index++;
} }
field_index *= int_size_in_bytes (field_type_node); field_index *= int_size_in_bytes (field_type_node);
ref = fold (build (PLUS_EXPR, field_ptr_type_node, ref = fold (build2 (PLUS_EXPR, field_ptr_type_node,
ref, build_int_2 (field_index, 0))); ref, build_int_2 (field_index, 0)));
ref = build1 (INDIRECT_REF, field_type_node, ref); ref = build1 (INDIRECT_REF, field_type_node, ref);
ref = build (COMPONENT_REF, field_info_union_node, ref = build3 (COMPONENT_REF, field_info_union_node,
ref, lookup_field (&field_type_node, info_ident), ref, lookup_field (&field_type_node, info_ident),
NULL_TREE); NULL_TREE);
ref = build (COMPONENT_REF, ptr_type_node, ref = build3 (COMPONENT_REF, ptr_type_node,
ref, TREE_CHAIN (TYPE_FIELDS (field_info_union_node)), ref, TREE_CHAIN (TYPE_FIELDS (field_info_union_node)),
NULL_TREE); NULL_TREE);
ref = build1 (NOP_EXPR, build_pointer_type (TREE_TYPE (fdecl)), ref); ref = build1 (NOP_EXPR, build_pointer_type (TREE_TYPE (fdecl)), ref);
return fold (build1 (INDIRECT_REF, TREE_TYPE(fdecl), ref)); return fold (build1 (INDIRECT_REF, TREE_TYPE(fdecl), ref));
} }
...@@ -1421,8 +1421,8 @@ get_dispatch_table (tree type, tree this_class_addr) ...@@ -1421,8 +1421,8 @@ get_dispatch_table (tree type, tree this_class_addr)
if (TARGET_VTABLE_USES_DESCRIPTORS) if (TARGET_VTABLE_USES_DESCRIPTORS)
for (j = 0; j < TARGET_VTABLE_USES_DESCRIPTORS; ++j) for (j = 0; j < TARGET_VTABLE_USES_DESCRIPTORS; ++j)
{ {
tree fdesc = build (FDESC_EXPR, nativecode_ptr_type_node, tree fdesc = build2 (FDESC_EXPR, nativecode_ptr_type_node,
method, build_int_2 (j, 0)); method, build_int_2 (j, 0));
TREE_CONSTANT (fdesc) = 1; TREE_CONSTANT (fdesc) = 1;
TREE_INVARIANT (fdesc) = 1; TREE_INVARIANT (fdesc) = 1;
list = tree_cons (NULL_TREE, fdesc, list); list = tree_cons (NULL_TREE, fdesc, list);
...@@ -1712,9 +1712,10 @@ make_class_data (tree type) ...@@ -1712,9 +1712,10 @@ make_class_data (tree type)
START_RECORD_CONSTRUCTOR (temp, object_type_node); START_RECORD_CONSTRUCTOR (temp, object_type_node);
PUSH_FIELD_VALUE (temp, "vtable", PUSH_FIELD_VALUE (temp, "vtable",
build (PLUS_EXPR, dtable_ptr_type, build2 (PLUS_EXPR, dtable_ptr_type,
build1 (ADDR_EXPR, dtable_ptr_type, class_dtable_decl), build1 (ADDR_EXPR, dtable_ptr_type,
dtable_start_offset)); class_dtable_decl),
dtable_start_offset));
if (! flag_hash_synchronization) if (! flag_hash_synchronization)
PUSH_FIELD_VALUE (temp, "sync_info", null_pointer_node); PUSH_FIELD_VALUE (temp, "sync_info", null_pointer_node);
FINISH_RECORD_CONSTRUCTOR (temp); FINISH_RECORD_CONSTRUCTOR (temp);
...@@ -1750,9 +1751,10 @@ make_class_data (tree type) ...@@ -1750,9 +1751,10 @@ make_class_data (tree type)
else else
PUSH_FIELD_VALUE (cons, "vtable", PUSH_FIELD_VALUE (cons, "vtable",
dtable_decl == NULL_TREE ? null_pointer_node dtable_decl == NULL_TREE ? null_pointer_node
: build (PLUS_EXPR, dtable_ptr_type, : build2 (PLUS_EXPR, dtable_ptr_type,
build1 (ADDR_EXPR, dtable_ptr_type, dtable_decl), build1 (ADDR_EXPR, dtable_ptr_type,
dtable_start_offset)); dtable_decl),
dtable_start_offset));
if (TYPE_OTABLE_METHODS (type) == NULL_TREE) if (TYPE_OTABLE_METHODS (type) == NULL_TREE)
{ {
PUSH_FIELD_VALUE (cons, "otable", null_pointer_node); PUSH_FIELD_VALUE (cons, "otable", null_pointer_node);
...@@ -2274,8 +2276,8 @@ layout_class_method (tree this_class, tree super_class, ...@@ -2274,8 +2276,8 @@ layout_class_method (tree this_class, tree super_class,
&& dtable_count) && dtable_count)
{ {
set_method_index (method_decl, dtable_count); set_method_index (method_decl, dtable_count);
dtable_count = fold (build (PLUS_EXPR, integer_type_node, dtable_count = fold (build2 (PLUS_EXPR, integer_type_node,
dtable_count, integer_one_node)); dtable_count, integer_one_node));
} }
} }
......
...@@ -425,8 +425,8 @@ build_ref_from_constant_pool (int index) ...@@ -425,8 +425,8 @@ build_ref_from_constant_pool (int index)
{ {
tree d = build_constant_data_ref (); tree d = build_constant_data_ref ();
tree i = build_int_2 (index, 0); tree i = build_int_2 (index, 0);
return build (ARRAY_REF, TREE_TYPE (TREE_TYPE (d)), d, i, return build4 (ARRAY_REF, TREE_TYPE (TREE_TYPE (d)), d, i,
NULL_TREE, NULL_TREE); NULL_TREE, NULL_TREE);
} }
/* Build an initializer for the constants field of the current constant pool. /* Build an initializer for the constants field of the current constant pool.
......
...@@ -113,8 +113,7 @@ update_aliases (tree decl, int index) ...@@ -113,8 +113,7 @@ update_aliases (tree decl, int index)
&& TYPE_MODE (type) == TYPE_MODE (TREE_TYPE (tmp))) && TYPE_MODE (type) == TYPE_MODE (TREE_TYPE (tmp)))
{ {
tree src = build1 (NOP_EXPR, TREE_TYPE (tmp), decl); tree src = build1 (NOP_EXPR, TREE_TYPE (tmp), decl);
java_add_stmt java_add_stmt (build2 (MODIFY_EXPR, TREE_TYPE (tmp), tmp, src));
(build (MODIFY_EXPR, TREE_TYPE (tmp), tmp, src));
} }
tmp = DECL_LOCAL_SLOT_CHAIN (tmp); tmp = DECL_LOCAL_SLOT_CHAIN (tmp);
} }
...@@ -139,8 +138,7 @@ push_jvm_slot (int index, tree decl) ...@@ -139,8 +138,7 @@ push_jvm_slot (int index, tree decl)
/* At the point of its creation this decl inherits whatever /* At the point of its creation this decl inherits whatever
is in the slot. */ is in the slot. */
tree src = build1 (NOP_EXPR, TREE_TYPE (decl), tmp); tree src = build1 (NOP_EXPR, TREE_TYPE (decl), tmp);
java_add_stmt java_add_stmt (build2 (MODIFY_EXPR, TREE_TYPE (decl), decl, src));
(build (MODIFY_EXPR, TREE_TYPE (decl), decl, src));
break; break;
} }
tmp = DECL_LOCAL_SLOT_CHAIN (tmp); tmp = DECL_LOCAL_SLOT_CHAIN (tmp);
...@@ -1345,7 +1343,7 @@ poplevel (int keep, int reverse, int functionbody) ...@@ -1345,7 +1343,7 @@ poplevel (int keep, int reverse, int functionbody)
} }
*var = NULL; *var = NULL;
bind = build (BIND_EXPR, TREE_TYPE (block), BLOCK_VARS (block), bind = build3 (BIND_EXPR, TREE_TYPE (block), BLOCK_VARS (block),
BLOCK_EXPR_BODY (block), block); BLOCK_EXPR_BODY (block), block);
BIND_EXPR_BODY (bind) = current_binding_level->stmts; BIND_EXPR_BODY (bind) = current_binding_level->stmts;
...@@ -1800,9 +1798,8 @@ finish_method (tree fndecl) ...@@ -1800,9 +1798,8 @@ finish_method (tree fndecl)
lock = DECL_ARGUMENTS (fndecl); lock = DECL_ARGUMENTS (fndecl);
BUILD_MONITOR_ENTER (enter, lock); BUILD_MONITOR_ENTER (enter, lock);
BUILD_MONITOR_EXIT (exit, lock); BUILD_MONITOR_EXIT (exit, lock);
*tp = build (COMPOUND_EXPR, void_type_node, *tp = build2 (COMPOUND_EXPR, void_type_node, enter,
enter, build2 (TRY_FINALLY_EXPR, void_type_node, *tp, exit));
build (TRY_FINALLY_EXPR, void_type_node, *tp, exit));
} }
/* Prepend class initialization for static methods reachable from /* Prepend class initialization for static methods reachable from
...@@ -1812,11 +1809,11 @@ finish_method (tree fndecl) ...@@ -1812,11 +1809,11 @@ finish_method (tree fndecl)
&& ! CLASS_INTERFACE (TYPE_NAME (DECL_CONTEXT (fndecl)))) && ! CLASS_INTERFACE (TYPE_NAME (DECL_CONTEXT (fndecl))))
{ {
tree clas = DECL_CONTEXT (fndecl); tree clas = DECL_CONTEXT (fndecl);
tree init = build (CALL_EXPR, void_type_node, tree init = build3 (CALL_EXPR, void_type_node,
build_address_of (soft_initclass_node), build_address_of (soft_initclass_node),
build_tree_list (NULL_TREE, build_class_ref (clas)), build_tree_list (NULL_TREE, build_class_ref (clas)),
NULL_TREE); NULL_TREE);
*tp = build (COMPOUND_EXPR, TREE_TYPE (*tp), init, *tp); *tp = build2 (COMPOUND_EXPR, TREE_TYPE (*tp), init, *tp);
} }
/* Convert function tree to GENERIC prior to inlining. */ /* Convert function tree to GENERIC prior to inlining. */
...@@ -1881,9 +1878,9 @@ add_stmt_to_compound (tree existing, tree type, tree stmt) ...@@ -1881,9 +1878,9 @@ add_stmt_to_compound (tree existing, tree type, tree stmt)
return existing; return existing;
else if (existing) else if (existing)
{ {
tree expr = build (COMPOUND_EXPR, type, existing, stmt); tree expr = build2 (COMPOUND_EXPR, type, existing, stmt);
TREE_SIDE_EFFECTS (expr) TREE_SIDE_EFFECTS (expr) = TREE_SIDE_EFFECTS (existing)
= TREE_SIDE_EFFECTS (existing) | TREE_SIDE_EFFECTS (stmt); | TREE_SIDE_EFFECTS (stmt);
return expr; return expr;
} }
else else
......
...@@ -412,9 +412,9 @@ build_exception_object_ref (tree type) ...@@ -412,9 +412,9 @@ build_exception_object_ref (tree type)
/* Java only passes object via pointer and doesn't require adjusting. /* Java only passes object via pointer and doesn't require adjusting.
The java object is immediately before the generic exception header. */ The java object is immediately before the generic exception header. */
obj = build (EXC_PTR_EXPR, build_pointer_type (type)); obj = build0 (EXC_PTR_EXPR, build_pointer_type (type));
obj = build (MINUS_EXPR, TREE_TYPE (obj), obj, obj = build2 (MINUS_EXPR, TREE_TYPE (obj), obj,
TYPE_SIZE_UNIT (TREE_TYPE (obj))); TYPE_SIZE_UNIT (TREE_TYPE (obj)));
obj = build1 (INDIRECT_REF, type, obj); obj = build1 (INDIRECT_REF, type, obj);
return obj; return obj;
...@@ -441,11 +441,11 @@ expand_end_java_handler (struct eh_range *range) ...@@ -441,11 +441,11 @@ expand_end_java_handler (struct eh_range *range)
type = prepare_eh_table_type (type); type = prepare_eh_table_type (type);
{ {
tree catch_expr tree catch_expr = build2 (CATCH_EXPR, void_type_node, type,
= build (CATCH_EXPR, void_type_node, type, build1 (GOTO_EXPR, void_type_node,
build (GOTO_EXPR, void_type_node, TREE_VALUE (handler))); TREE_VALUE (handler)));
tree try_catch_expr = build (TRY_CATCH_EXPR, void_type_node, tree try_catch_expr = build2 (TRY_CATCH_EXPR, void_type_node,
*get_stmts (), catch_expr); *get_stmts (), catch_expr);
*get_stmts () = try_catch_expr; *get_stmts () = try_catch_expr;
} }
} }
......
...@@ -144,15 +144,15 @@ static tree ...@@ -144,15 +144,15 @@ static tree
java_gimplify_case_expr (tree expr) java_gimplify_case_expr (tree expr)
{ {
tree label = create_artificial_label (); tree label = create_artificial_label ();
return build (CASE_LABEL_EXPR, void_type_node, return build3 (CASE_LABEL_EXPR, void_type_node,
TREE_OPERAND (expr, 0), NULL_TREE, label); TREE_OPERAND (expr, 0), NULL_TREE, label);
} }
static tree static tree
java_gimplify_default_expr (tree expr ATTRIBUTE_UNUSED) java_gimplify_default_expr (tree expr ATTRIBUTE_UNUSED)
{ {
tree label = create_artificial_label (); tree label = create_artificial_label ();
return build (CASE_LABEL_EXPR, void_type_node, NULL_TREE, NULL_TREE, label); return build3 (CASE_LABEL_EXPR, void_type_node, NULL_TREE, NULL_TREE, label);
} }
/* Gimplify BLOCK into a BIND_EXPR. */ /* Gimplify BLOCK into a BIND_EXPR. */
...@@ -187,7 +187,7 @@ java_gimplify_block (tree java_block) ...@@ -187,7 +187,7 @@ java_gimplify_block (tree java_block)
BLOCK_SUBBLOCKS (outer) = chainon (BLOCK_SUBBLOCKS (outer), block); BLOCK_SUBBLOCKS (outer) = chainon (BLOCK_SUBBLOCKS (outer), block);
} }
return build (BIND_EXPR, TREE_TYPE (java_block), decls, body, block); return build3 (BIND_EXPR, TREE_TYPE (java_block), decls, body, block);
} }
/* Gimplify a NEW_ARRAY_INIT node into array/element assignments. */ /* Gimplify a NEW_ARRAY_INIT node into array/element assignments. */
...@@ -204,11 +204,12 @@ java_gimplify_new_array_init (tree exp) ...@@ -204,11 +204,12 @@ java_gimplify_new_array_init (tree exp)
tree values = CONSTRUCTOR_ELTS (init); tree values = CONSTRUCTOR_ELTS (init);
tree array_ptr_type = build_pointer_type (array_type); tree array_ptr_type = build_pointer_type (array_type);
tree block = build (BLOCK, array_ptr_type); tree block = build0 (BLOCK, array_ptr_type);
tree tmp = build_decl (VAR_DECL, get_identifier ("<tmp>"), array_ptr_type); tree tmp = build_decl (VAR_DECL, get_identifier ("<tmp>"), array_ptr_type);
tree array = build_decl (VAR_DECL, get_identifier ("<array>"), array_ptr_type); tree array = build_decl (VAR_DECL, get_identifier ("<array>"),
tree body = build (MODIFY_EXPR, array_ptr_type, tmp, array_ptr_type);
build_new_array (element_type, length)); tree body = build2 (MODIFY_EXPR, array_ptr_type, tmp,
build_new_array (element_type, length));
int index = 0; int index = 0;
...@@ -220,20 +221,20 @@ java_gimplify_new_array_init (tree exp) ...@@ -220,20 +221,20 @@ java_gimplify_new_array_init (tree exp)
{ {
/* FIXME: Should use build_java_arrayaccess here, but avoid /* FIXME: Should use build_java_arrayaccess here, but avoid
bounds checking. */ bounds checking. */
tree lhs = build (COMPONENT_REF, TREE_TYPE (data_field), tree lhs = build3 (COMPONENT_REF, TREE_TYPE (data_field),
build_java_indirect_ref (array_type, tmp, 0), build_java_indirect_ref (array_type, tmp, 0),
data_field, NULL_TREE); data_field, NULL_TREE);
tree assignment = build (MODIFY_EXPR, element_type, tree assignment = build2 (MODIFY_EXPR, element_type,
build (ARRAY_REF, element_type, lhs, build4 (ARRAY_REF, element_type, lhs,
build_int_2 (index++, 0), build_int_2 (index++, 0),
NULL_TREE, NULL_TREE), NULL_TREE, NULL_TREE),
TREE_VALUE (values)); TREE_VALUE (values));
body = build (COMPOUND_EXPR, element_type, body, assignment); body = build2 (COMPOUND_EXPR, element_type, body, assignment);
values = TREE_CHAIN (values); values = TREE_CHAIN (values);
} }
body = build (COMPOUND_EXPR, array_ptr_type, body, body = build2 (COMPOUND_EXPR, array_ptr_type, body,
build (MODIFY_EXPR, array_ptr_type, array, tmp)); build2 (MODIFY_EXPR, array_ptr_type, array, tmp));
TREE_CHAIN (tmp) = array; TREE_CHAIN (tmp) = array;
BLOCK_VARS (block) = tmp; BLOCK_VARS (block) = tmp;
BLOCK_EXPR_BODY (block) = body; BLOCK_EXPR_BODY (block) = body;
...@@ -252,16 +253,16 @@ java_gimplify_try_expr (tree try_expr) ...@@ -252,16 +253,16 @@ java_gimplify_try_expr (tree try_expr)
{ {
tree java_catch = TREE_OPERAND (handler, 0); tree java_catch = TREE_OPERAND (handler, 0);
tree catch_type = TREE_TYPE (TREE_TYPE (BLOCK_EXPR_DECLS (java_catch))); tree catch_type = TREE_TYPE (TREE_TYPE (BLOCK_EXPR_DECLS (java_catch)));
tree expr = build (CATCH_EXPR, void_type_node, tree expr = build2 (CATCH_EXPR, void_type_node,
prepare_eh_table_type (catch_type), prepare_eh_table_type (catch_type),
handler); handler);
if (catch) if (catch)
catch = build (COMPOUND_EXPR, void_type_node, catch, expr); catch = build2 (COMPOUND_EXPR, void_type_node, catch, expr);
else else
catch = expr; catch = expr;
handler = TREE_CHAIN (handler); handler = TREE_CHAIN (handler);
} }
return build (TRY_CATCH_EXPR, void_type_node, body, catch); return build2 (TRY_CATCH_EXPR, void_type_node, body, catch);
} }
/* Dump a tree of some kind. This is a convenience wrapper for the /* Dump a tree of some kind. This is a convenience wrapper for the
......
...@@ -2067,8 +2067,8 @@ generate_bytecode_insns (tree exp, int target, struct jcf_partial *state) ...@@ -2067,8 +2067,8 @@ generate_bytecode_insns (tree exp, int target, struct jcf_partial *state)
/* This function correctly handles the case where the LHS /* This function correctly handles the case where the LHS
of a binary expression is NULL_TREE. */ of a binary expression is NULL_TREE. */
rhs = build (TREE_CODE (rhs), TREE_TYPE (rhs), rhs = build2 (TREE_CODE (rhs), TREE_TYPE (rhs),
NULL_TREE, TREE_OPERAND (rhs, 1)); NULL_TREE, TREE_OPERAND (rhs, 1));
} }
generate_bytecode_insns (rhs, STACK_TARGET, state); generate_bytecode_insns (rhs, STACK_TARGET, state);
...@@ -2490,9 +2490,9 @@ generate_bytecode_insns (tree exp, int target, struct jcf_partial *state) ...@@ -2490,9 +2490,9 @@ generate_bytecode_insns (tree exp, int target, struct jcf_partial *state)
tree x; tree x;
if (TREE_SIDE_EFFECTS (op0) || TREE_SIDE_EFFECTS (op1)) if (TREE_SIDE_EFFECTS (op0) || TREE_SIDE_EFFECTS (op1))
abort (); abort ();
x = build (COND_EXPR, TREE_TYPE (exp), x = build3 (COND_EXPR, TREE_TYPE (exp),
build (code, boolean_type_node, op0, op1), build2 (code, boolean_type_node, op0, op1),
op0, op1); op0, op1);
generate_bytecode_insns (x, target, state); generate_bytecode_insns (x, target, state);
break; break;
} }
......
...@@ -83,22 +83,22 @@ convert_ieee_real_to_integer (tree type, tree expr) ...@@ -83,22 +83,22 @@ convert_ieee_real_to_integer (tree type, tree expr)
tree result; tree result;
expr = save_expr (expr); expr = save_expr (expr);
result = build (COND_EXPR, type, result = build3 (COND_EXPR, type,
build (NE_EXPR, boolean_type_node, expr, expr), build2 (NE_EXPR, boolean_type_node, expr, expr),
convert (type, integer_zero_node), convert (type, integer_zero_node),
convert_to_integer (type, expr)); convert_to_integer (type, expr));
result = build (COND_EXPR, type, result = build3 (COND_EXPR, type,
build (LE_EXPR, boolean_type_node, expr, build2 (LE_EXPR, boolean_type_node, expr,
convert (TREE_TYPE (expr), TYPE_MIN_VALUE (type))), convert (TREE_TYPE (expr), TYPE_MIN_VALUE (type))),
TYPE_MIN_VALUE (type), TYPE_MIN_VALUE (type),
result); result);
result = build (COND_EXPR, type, result = build3 (COND_EXPR, type,
build (GE_EXPR, boolean_type_node, expr, build2 (GE_EXPR, boolean_type_node, expr,
convert (TREE_TYPE (expr), TYPE_MAX_VALUE (type))), convert (TREE_TYPE (expr), TYPE_MAX_VALUE (type))),
TYPE_MAX_VALUE (type), TYPE_MAX_VALUE (type),
result); result);
return result; return result;
} }
......
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