diff options
| author | bryce <bryce@138bc75d-0d04-0410-961f-82ee72b054a4> | 2004-08-10 15:41:15 +0000 |
|---|---|---|
| committer | bryce <bryce@138bc75d-0d04-0410-961f-82ee72b054a4> | 2004-08-10 15:41:15 +0000 |
| commit | 49ede24f4b2a99f56edc11c61cfe7487f64f9dc0 (patch) | |
| tree | 9dcc5aba0032213c474b293fd463c790720cda3d /gcc/java/java-gimplify.c | |
| parent | e7fd7319a67708b6c963c9e38f3cfb4798bde5bd (diff) | |
| download | ppe42-gcc-49ede24f4b2a99f56edc11c61cfe7487f64f9dc0.tar.gz ppe42-gcc-49ede24f4b2a99f56edc11c61cfe7487f64f9dc0.zip | |
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.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@85756 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/java/java-gimplify.c')
| -rw-r--r-- | gcc/java/java-gimplify.c | 15 |
1 files changed, 2 insertions, 13 deletions
diff --git a/gcc/java/java-gimplify.c b/gcc/java/java-gimplify.c index 5dd69bf40fe..2d3be9995a3 100644 --- a/gcc/java/java-gimplify.c +++ b/gcc/java/java-gimplify.c @@ -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 |

