mirror of
git://gcc.gnu.org/git/gcc.git
synced 2025-03-19 22:41:28 +08:00
java-gimplify.c (java_gimplify_new_array_init): Use create_tmp_var.
2004-08-10 Bryce McKinlay <mckinlay@redhat.com> * java-gimplify.c (java_gimplify_new_array_init): Use create_tmp_var. Don't create BLOCK here or call java_gimplify_block. From-SVN: r85756
This commit is contained in:
parent
7e04b67b77
commit
f97b53df78
@ -1,3 +1,8 @@
|
||||
2004-08-10 Bryce McKinlay <mckinlay@redhat.com>
|
||||
|
||||
* java-gimplify.c (java_gimplify_new_array_init): Use create_tmp_var.
|
||||
Don't create BLOCK here or call java_gimplify_block.
|
||||
|
||||
2004-08-09 H.J. Lu <hongjiu.lu@intel.com>
|
||||
|
||||
* java-tree.h (flag_deprecated): Removed.
|
||||
|
@ -247,18 +247,12 @@ java_gimplify_new_array_init (tree exp)
|
||||
tree values = CONSTRUCTOR_ELTS (init);
|
||||
|
||||
tree array_ptr_type = build_pointer_type (array_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 tmp = create_tmp_var (array_ptr_type, "array");
|
||||
tree body = build2 (MODIFY_EXPR, array_ptr_type, tmp,
|
||||
build_new_array (element_type, length));
|
||||
|
||||
int index = 0;
|
||||
|
||||
DECL_CONTEXT (array) = current_function_decl;
|
||||
DECL_CONTEXT (tmp) = current_function_decl;
|
||||
|
||||
/* FIXME: try to allocate array statically? */
|
||||
while (values != NULL_TREE)
|
||||
{
|
||||
@ -276,12 +270,7 @@ java_gimplify_new_array_init (tree exp)
|
||||
values = TREE_CHAIN (values);
|
||||
}
|
||||
|
||||
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;
|
||||
return java_gimplify_block (block);
|
||||
return build2 (COMPOUND_EXPR, array_ptr_type, body, tmp);
|
||||
}
|
||||
|
||||
static tree
|
||||
|
Loading…
x
Reference in New Issue
Block a user