diff options
Diffstat (limited to 'gcc/java')
-rw-r--r-- | gcc/java/ChangeLog | 10 | ||||
-rw-r--r-- | gcc/java/decl.c | 29 | ||||
-rw-r--r-- | gcc/java/java-tree.h | 1 | ||||
-rw-r--r-- | gcc/java/lang.c | 13 |
4 files changed, 26 insertions, 27 deletions
diff --git a/gcc/java/ChangeLog b/gcc/java/ChangeLog index 6934f07..c6966eb 100644 --- a/gcc/java/ChangeLog +++ b/gcc/java/ChangeLog @@ -1,3 +1,13 @@ +2004-07-11 Joseph S. Myers <jsm@polyomino.org.uk> + + * java-tree.h (set_block): Remove. + * lang.c (java_clear_binding_stack): New. + (LANG_HOOKS_CLEAR_BINDING_STACK): Define. + * decl.c (struct binding_level): Remove this_block. + (clear_binding_level): Likewise. + (poplevel): Don't handle this_block. + (set_block): Remove. + 2004-07-10 Bryce McKinlay <mckinlay@redhat.com> * class.c (common_enclosing_context_p): Remove statement with no diff --git a/gcc/java/decl.c b/gcc/java/decl.c index 5f2771d..b028967 100644 --- a/gcc/java/decl.c +++ b/gcc/java/decl.c @@ -299,10 +299,6 @@ struct binding_level GTY(()) that were entered and exited one level down. */ tree blocks; - /* The BLOCK node for this level, if one has been preallocated. - If 0, the BLOCK is allocated (if needed) when the level is popped. */ - tree this_block; - /* The binding level which this one is contained in (inherits from). */ struct binding_level *level_chain; @@ -348,7 +344,6 @@ static const struct binding_level clear_binding_level NULL_TREE, /* names */ NULL_TREE, /* shadowed */ NULL_TREE, /* blocks */ - NULL_TREE, /* this_lock */ NULL_BINDING_LEVEL, /* level_chain */ LARGEST_PC, /* end_pc */ 0, /* start_pc */ @@ -1276,7 +1271,6 @@ poplevel (int keep, int reverse, int functionbody) tree block = 0; tree decl; tree bind = 0; - int block_previously_created; #if defined(DEBUG_JAVA_BINDING_LEVELS) binding_depth--; @@ -1319,10 +1313,7 @@ poplevel (int keep, int reverse, int functionbody) create a BLOCK to record them for the life of this function. */ block = 0; - block_previously_created = (current_binding_level->this_block != 0); - if (block_previously_created) - block = current_binding_level->this_block; - else if (keep || functionbody) + if (keep || functionbody) { block = make_node (BLOCK); TREE_TYPE (block) = void_type_node; @@ -1466,9 +1457,8 @@ poplevel (int keep, int reverse, int functionbody) { if (block) { - if (!block_previously_created) - current_binding_level->blocks - = chainon (current_binding_level->blocks, block); + current_binding_level->blocks + = chainon (current_binding_level->blocks, block); } /* If we did not make a block for the level just exited, any blocks made for inner levels @@ -1571,19 +1561,6 @@ insert_block (tree block) = chainon (current_binding_level->blocks, block); } -/* Set the BLOCK node for the innermost scope - (the one we are currently in). */ - -void -set_block (tree block) -{ - current_binding_level->this_block = block; - current_binding_level->names = chainon (current_binding_level->names, - BLOCK_VARS (block)); - current_binding_level->blocks = chainon (current_binding_level->blocks, - BLOCK_SUBBLOCKS (block)); -} - /* integrate_decl_tree calls this function. */ void diff --git a/gcc/java/java-tree.h b/gcc/java/java-tree.h index d9e6415..2cf9145 100644 --- a/gcc/java/java-tree.h +++ b/gcc/java/java-tree.h @@ -1171,7 +1171,6 @@ extern tree getdecls (void); extern void pushlevel (int); extern tree poplevel (int,int, int); extern void insert_block (tree); -extern void set_block (tree); extern tree pushdecl (tree); extern void java_init_decl_processing (void); extern void java_dup_lang_specific_decl (tree); diff --git a/gcc/java/lang.c b/gcc/java/lang.c index b50977e..d3ba372 100644 --- a/gcc/java/lang.c +++ b/gcc/java/lang.c @@ -67,6 +67,7 @@ static bool java_dump_tree (void *, tree); static void dump_compound_expr (dump_info_p, tree); static bool java_decl_ok_for_sibcall (tree); static tree java_get_callee_fndecl (tree); +static void java_clear_binding_stack (void); #ifndef TARGET_OBJECT_SUFFIX # define TARGET_OBJECT_SUFFIX ".o" @@ -264,6 +265,9 @@ struct language_function GTY(()) #undef LANG_HOOKS_CALLGRAPH_EXPAND_FUNCTION #define LANG_HOOKS_CALLGRAPH_EXPAND_FUNCTION java_expand_body +#undef LANG_HOOKS_CLEAR_BINDING_STACK +#define LANG_HOOKS_CLEAR_BINDING_STACK java_clear_binding_stack + /* Each front end provides its own. */ const struct lang_hooks lang_hooks = LANG_HOOKS_INITIALIZER; @@ -1160,4 +1164,13 @@ java_get_callee_fndecl (tree call_expr) return NULL; } + +/* Clear the binding stack. */ +static void +java_clear_binding_stack (void) +{ + while (!global_bindings_p ()) + poplevel (0, 0, 0); +} + #include "gt-java-lang.h" |