aboutsummaryrefslogtreecommitdiff
path: root/gcc/java/java-gimplify.c
diff options
context:
space:
mode:
authorRoger Sayle <roger@eyesopen.com>2004-07-18 13:17:03 +0000
committerRoger Sayle <sayle@gcc.gnu.org>2004-07-18 13:17:03 +0000
commit94cdeb1ad33b77f10f4cbc56bbce5d5f9c6b703c (patch)
tree1f13dfd1858fc89f9b7558e0830a0adc266edb2b /gcc/java/java-gimplify.c
parent3d23e0184a2917a9e5b1ef56b7a3c99d6398f08d (diff)
downloadgcc-94cdeb1ad33b77f10f4cbc56bbce5d5f9c6b703c.zip
gcc-94cdeb1ad33b77f10f4cbc56bbce5d5f9c6b703c.tar.gz
gcc-94cdeb1ad33b77f10f4cbc56bbce5d5f9c6b703c.tar.bz2
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
Diffstat (limited to 'gcc/java/java-gimplify.c')
-rw-r--r--gcc/java/java-gimplify.c49
1 files changed, 25 insertions, 24 deletions
diff --git a/gcc/java/java-gimplify.c b/gcc/java/java-gimplify.c
index 766995e..64cb7ce 100644
--- a/gcc/java/java-gimplify.c
+++ b/gcc/java/java-gimplify.c
@@ -144,15 +144,15 @@ static tree
java_gimplify_case_expr (tree expr)
{
tree label = create_artificial_label ();
- return build (CASE_LABEL_EXPR, void_type_node,
- TREE_OPERAND (expr, 0), NULL_TREE, label);
+ return build3 (CASE_LABEL_EXPR, void_type_node,
+ TREE_OPERAND (expr, 0), NULL_TREE, label);
}
static tree
java_gimplify_default_expr (tree expr ATTRIBUTE_UNUSED)
{
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. */
@@ -187,7 +187,7 @@ java_gimplify_block (tree java_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. */
@@ -204,11 +204,12 @@ java_gimplify_new_array_init (tree exp)
tree values = CONSTRUCTOR_ELTS (init);
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 array = build_decl (VAR_DECL, get_identifier ("<array>"), array_ptr_type);
- tree body = build (MODIFY_EXPR, array_ptr_type, tmp,
- build_new_array (element_type, length));
+ tree array = build_decl (VAR_DECL, get_identifier ("<array>"),
+ array_ptr_type);
+ tree body = build2 (MODIFY_EXPR, array_ptr_type, tmp,
+ build_new_array (element_type, length));
int index = 0;
@@ -220,20 +221,20 @@ java_gimplify_new_array_init (tree exp)
{
/* FIXME: Should use build_java_arrayaccess here, but avoid
bounds checking. */
- tree lhs = build (COMPONENT_REF, TREE_TYPE (data_field),
- build_java_indirect_ref (array_type, tmp, 0),
- data_field, NULL_TREE);
- tree assignment = build (MODIFY_EXPR, element_type,
- build (ARRAY_REF, element_type, lhs,
- build_int_2 (index++, 0),
- NULL_TREE, NULL_TREE),
- TREE_VALUE (values));
- body = build (COMPOUND_EXPR, element_type, body, assignment);
+ tree lhs = build3 (COMPONENT_REF, TREE_TYPE (data_field),
+ build_java_indirect_ref (array_type, tmp, 0),
+ data_field, NULL_TREE);
+ tree assignment = build2 (MODIFY_EXPR, element_type,
+ build4 (ARRAY_REF, element_type, lhs,
+ build_int_2 (index++, 0),
+ NULL_TREE, NULL_TREE),
+ TREE_VALUE (values));
+ body = build2 (COMPOUND_EXPR, element_type, body, assignment);
values = TREE_CHAIN (values);
}
- body = build (COMPOUND_EXPR, array_ptr_type, body,
- build (MODIFY_EXPR, array_ptr_type, array, tmp));
+ body = build2 (COMPOUND_EXPR, array_ptr_type, body,
+ build2 (MODIFY_EXPR, array_ptr_type, array, tmp));
TREE_CHAIN (tmp) = array;
BLOCK_VARS (block) = tmp;
BLOCK_EXPR_BODY (block) = body;
@@ -252,16 +253,16 @@ java_gimplify_try_expr (tree try_expr)
{
tree java_catch = TREE_OPERAND (handler, 0);
tree catch_type = TREE_TYPE (TREE_TYPE (BLOCK_EXPR_DECLS (java_catch)));
- tree expr = build (CATCH_EXPR, void_type_node,
- prepare_eh_table_type (catch_type),
- handler);
+ tree expr = build2 (CATCH_EXPR, void_type_node,
+ prepare_eh_table_type (catch_type),
+ handler);
if (catch)
- catch = build (COMPOUND_EXPR, void_type_node, catch, expr);
+ catch = build2 (COMPOUND_EXPR, void_type_node, catch, expr);
else
catch = expr;
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