diff options
| author | pinskia <pinskia@138bc75d-0d04-0410-961f-82ee72b054a4> | 2004-11-26 18:04:45 +0000 |
|---|---|---|
| committer | pinskia <pinskia@138bc75d-0d04-0410-961f-82ee72b054a4> | 2004-11-26 18:04:45 +0000 |
| commit | 549839e78ddb78fc6f722fd910bd8c5d0e5f326c (patch) | |
| tree | fd510bfba4be46b5f8449a5f32932ed69e327402 /gcc/java/expr.c | |
| parent | fc64a85ec52360dc6a70965820efc1ba38eb61b9 (diff) | |
| download | ppe42-gcc-549839e78ddb78fc6f722fd910bd8c5d0e5f326c.tar.gz ppe42-gcc-549839e78ddb78fc6f722fd910bd8c5d0e5f326c.zip | |
2004-11-26 Andrew Pinski <pinskia@physics.uc.edu>
PR java/18305
* decl.c (end_java_method): Call
attach_init_test_initialization_flags on all the init_decls.
* parse.y (attach_init_test_initialization_flags): Move to ...
* expr.c (attach_init_test_initialization_flags): here and
support BIND_EXPR also.
* java-tree.h (attach_init_test_initialization_flags): Prototype.
* jcf-parse.c (parse_class_file): Don't disable class init
optimization.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@91343 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/java/expr.c')
| -rw-r--r-- | gcc/java/expr.c | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/gcc/java/expr.c b/gcc/java/expr.c index 305ab5bdfee..0fef94db9d4 100644 --- a/gcc/java/expr.c +++ b/gcc/java/expr.c @@ -1935,6 +1935,39 @@ pop_arguments (tree arg_types) abort (); } +/* Attach to PTR (a block) the declaration found in ENTRY. */ + +int +attach_init_test_initialization_flags (void **entry, void *ptr) +{ + tree block = (tree)ptr; + struct treetreehash_entry *ite = (struct treetreehash_entry *) *entry; + + if (block != error_mark_node) + { + if (TREE_CODE (block) == BIND_EXPR) + { + tree body = BIND_EXPR_BODY (block); + TREE_CHAIN (ite->value) = BIND_EXPR_VARS (block); + BIND_EXPR_VARS (block) = ite->value; + body = build2 (COMPOUND_EXPR, void_type_node, + build1 (DECL_EXPR, void_type_node, ite->value), body); + BIND_EXPR_BODY (block) = body; + } + else + { + tree body = BLOCK_SUBBLOCKS (block); + TREE_CHAIN (ite->value) = BLOCK_EXPR_DECLS (block); + BLOCK_EXPR_DECLS (block) = ite->value; + body = build2 (COMPOUND_EXPR, void_type_node, + build1 (DECL_EXPR, void_type_node, ite->value), body); + BLOCK_SUBBLOCKS (block) = body; + } + + } + return true; +} + /* Build an expression to initialize the class CLAS. if EXPR is non-NULL, returns an expression to first call the initializer (if it is needed) and then calls EXPR. */ |

