Commit 41f701ba by Tom Tromey Committed by Tom Tromey

java-tree.h (push_labeled_block, [...]): Remove.

	* java-tree.h (push_labeled_block, pop_labeled_block): Remove.
	(LABELED_BLOCK_LABEL, LABELED_BLOCK_BODY,
	EXIT_BLOCK_LABELED_BLOCK): Likewise.
	* lang.c (java_tree_inlining_walk_subtrees): Update.
	(java_dump_tree): Likewise.
	* java-tree.def (LABELED_BLOCK_EXPR, EXIT_BLOCK_EXPR, TRY_EXPR):
	Remove.
	* decl.c (push_labeled_block, pop_labeled_block): Remove.
	* java-gimplify.c (java_gimplify_labeled_block_expr,
	java_gimplify_exit_block_expr, java_gimplify_try_expr): Remove.
	(java_gimplify_expr): Update.

From-SVN: r126962
parent 8fee41c2
2007-07-26 Tom Tromey <tromey@redhat.com>
* java-tree.h (push_labeled_block, pop_labeled_block): Remove.
(LABELED_BLOCK_LABEL, LABELED_BLOCK_BODY,
EXIT_BLOCK_LABELED_BLOCK): Likewise.
* lang.c (java_tree_inlining_walk_subtrees): Update.
(java_dump_tree): Likewise.
* java-tree.def (LABELED_BLOCK_EXPR, EXIT_BLOCK_EXPR, TRY_EXPR):
Remove.
* decl.c (push_labeled_block, pop_labeled_block): Remove.
* java-gimplify.c (java_gimplify_labeled_block_expr,
java_gimplify_exit_block_expr, java_gimplify_try_expr): Remove.
(java_gimplify_expr): Update.
2007-07-25 Kaveh R. Ghazi <ghazi@caip.rutgers.edu> 2007-07-25 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
* class.c (java_treetreehash_hash, java_treetreehash_compare): * class.c (java_treetreehash_hash, java_treetreehash_compare):
......
...@@ -1126,41 +1126,6 @@ lookup_name_current_level (tree name) ...@@ -1126,41 +1126,6 @@ lookup_name_current_level (tree name)
return t; return t;
} }
/* Use a binding level to record a labeled block declaration */
void
push_labeled_block (tree lb)
{
tree name = DECL_NAME (LABELED_BLOCK_LABEL (lb));
struct binding_level *b = current_binding_level;
tree oldlocal = IDENTIFIER_LOCAL_VALUE (name);
if (oldlocal != 0)
b->shadowed = tree_cons (name, oldlocal, b->shadowed);
TREE_CHAIN (lb) = b->names;
b->names = lb;
IDENTIFIER_LOCAL_VALUE (name) = lb;
}
/* Pop the current binding level, reinstalling values for the previous
labeled block */
void
pop_labeled_block (void)
{
struct binding_level *b = current_binding_level;
tree label = b->names;
IDENTIFIER_LOCAL_VALUE (DECL_NAME (LABELED_BLOCK_LABEL (label))) =
NULL_TREE;
if (b->shadowed)
IDENTIFIER_LOCAL_VALUE (TREE_PURPOSE (b->shadowed)) =
TREE_VALUE (b->shadowed);
/* Pop the current level, and free the structure for reuse. */
current_binding_level = current_binding_level->level_chain;
b->level_chain = free_binding_level;
free_binding_level = b;
}
/* Record a decl-node X as belonging to the current lexical scope. /* Record a decl-node X as belonging to the current lexical scope.
Check for errors (such as an incompatible declaration for the same Check for errors (such as an incompatible declaration for the same
name already seen in the same scope). name already seen in the same scope).
......
...@@ -32,10 +32,7 @@ The Free Software Foundation is independent of Sun Microsystems, Inc. */ ...@@ -32,10 +32,7 @@ The Free Software Foundation is independent of Sun Microsystems, Inc. */
#include "tree-gimple.h" #include "tree-gimple.h"
#include "toplev.h" #include "toplev.h"
static tree java_gimplify_labeled_block_expr (tree);
static tree java_gimplify_exit_block_expr (tree);
static tree java_gimplify_block (tree); static tree java_gimplify_block (tree);
static tree java_gimplify_try_expr (tree);
static enum gimplify_status java_gimplify_modify_expr (tree*, tree*, tree *); static enum gimplify_status java_gimplify_modify_expr (tree*, tree*, tree *);
static enum gimplify_status java_gimplify_component_ref (tree*, tree*, tree *); static enum gimplify_status java_gimplify_component_ref (tree*, tree*, tree *);
static enum gimplify_status java_gimplify_self_mod_expr (tree*, tree*, tree *); static enum gimplify_status java_gimplify_self_mod_expr (tree*, tree*, tree *);
...@@ -69,18 +66,6 @@ java_gimplify_expr (tree *expr_p, tree *pre_p ATTRIBUTE_UNUSED, ...@@ -69,18 +66,6 @@ java_gimplify_expr (tree *expr_p, tree *pre_p ATTRIBUTE_UNUSED,
*expr_p = java_gimplify_block (*expr_p); *expr_p = java_gimplify_block (*expr_p);
break; break;
case LABELED_BLOCK_EXPR:
*expr_p = java_gimplify_labeled_block_expr (*expr_p);
break;
case EXIT_BLOCK_EXPR:
*expr_p = java_gimplify_exit_block_expr (*expr_p);
break;
case TRY_EXPR:
*expr_p = java_gimplify_try_expr (*expr_p);
break;
case VAR_DECL: case VAR_DECL:
*expr_p = java_replace_reference (*expr_p, /* want_lvalue */ false); *expr_p = java_replace_reference (*expr_p, /* want_lvalue */ false);
return GS_UNHANDLED; return GS_UNHANDLED;
...@@ -144,41 +129,6 @@ java_gimplify_expr (tree *expr_p, tree *pre_p ATTRIBUTE_UNUSED, ...@@ -144,41 +129,6 @@ java_gimplify_expr (tree *expr_p, tree *pre_p ATTRIBUTE_UNUSED,
return GS_OK; return GS_OK;
} }
/* Gimplify a LABELED_BLOCK_EXPR into a LABEL_EXPR following
a (possibly empty) body. */
static tree
java_gimplify_labeled_block_expr (tree expr)
{
tree body = LABELED_BLOCK_BODY (expr);
tree label = LABELED_BLOCK_LABEL (expr);
tree t;
DECL_CONTEXT (label) = current_function_decl;
t = build1 (LABEL_EXPR, void_type_node, label);
if (body != NULL_TREE)
t = build2 (COMPOUND_EXPR, void_type_node, body, t);
return t;
}
/* Gimplify a EXIT_BLOCK_EXPR into a GOTO_EXPR. */
static tree
java_gimplify_exit_block_expr (tree expr)
{
tree labeled_block = EXIT_BLOCK_LABELED_BLOCK (expr);
tree label;
/* First operand must be a LABELED_BLOCK_EXPR, which should
already be lowered (or partially lowered) when we get here. */
gcc_assert (TREE_CODE (labeled_block) == LABELED_BLOCK_EXPR);
label = LABELED_BLOCK_LABEL (labeled_block);
return build1 (GOTO_EXPR, void_type_node, label);
}
static enum gimplify_status static enum gimplify_status
java_gimplify_component_ref (tree *expr_p, tree *pre_p, tree *post_p) java_gimplify_component_ref (tree *expr_p, tree *pre_p, tree *post_p)
{ {
...@@ -347,30 +297,6 @@ java_gimplify_block (tree java_block) ...@@ -347,30 +297,6 @@ java_gimplify_block (tree java_block)
return build3 (BIND_EXPR, TREE_TYPE (java_block), decls, body, block); return build3 (BIND_EXPR, TREE_TYPE (java_block), decls, body, block);
} }
static tree
java_gimplify_try_expr (tree try_expr)
{
tree body = TREE_OPERAND (try_expr, 0);
tree handler = TREE_OPERAND (try_expr, 1);
tree catch = NULL_TREE;
/* Build a CATCH_EXPR for each handler. */
while (handler)
{
tree java_catch = TREE_OPERAND (handler, 0);
tree catch_type = TREE_TYPE (TREE_TYPE (BLOCK_EXPR_DECLS (java_catch)));
tree expr = build2 (CATCH_EXPR, void_type_node,
prepare_eh_table_type (catch_type),
handler);
if (catch)
catch = build2 (COMPOUND_EXPR, void_type_node, catch, expr);
else
catch = expr;
handler = TREE_CHAIN (handler);
}
return build2 (TRY_CATCH_EXPR, void_type_node, body, catch);
}
/* Dump a tree of some kind. This is a convenience wrapper for the /* Dump a tree of some kind. This is a convenience wrapper for the
dump_* functions in tree-dump.c. */ dump_* functions in tree-dump.c. */
static void static void
......
...@@ -32,19 +32,6 @@ DEFTREECODE (COMPARE_L_EXPR, "compare_l_expr", tcc_binary, 2) ...@@ -32,19 +32,6 @@ DEFTREECODE (COMPARE_L_EXPR, "compare_l_expr", tcc_binary, 2)
/* Same as COMPARE_EXPR, but if either value is NaN, the result is 1. */ /* Same as COMPARE_EXPR, but if either value is NaN, the result is 1. */
DEFTREECODE (COMPARE_G_EXPR, "compare_g_expr", tcc_binary, 2) DEFTREECODE (COMPARE_G_EXPR, "compare_g_expr", tcc_binary, 2)
/* A labeled block. Operand 0 is the label that will be generated to
mark the end of the block. Operand 1 is the labeled block body. */
DEFTREECODE (LABELED_BLOCK_EXPR, "labeled_block_expr", tcc_expression, 2)
/* Exit a labeled block, possibly returning a value. Operand 0 is a
LABELED_BLOCK_EXPR to exit. */
DEFTREECODE (EXIT_BLOCK_EXPR, "exit_block_expr", tcc_statement, 1)
/* Try expression
Operand 0 is the tried block,
Operand 1 contains chained catch nodes. */
DEFTREECODE (TRY_EXPR, "try-catch", tcc_expression, 2)
/* /*
Local variables: Local variables:
mode:c mode:c
......
...@@ -1198,12 +1198,10 @@ extern tree java_check_reference (tree, int); ...@@ -1198,12 +1198,10 @@ extern tree java_check_reference (tree, int);
extern tree build_get_class (tree); extern tree build_get_class (tree);
extern tree build_instanceof (tree, tree); extern tree build_instanceof (tree, tree);
extern tree create_label_decl (tree); extern tree create_label_decl (tree);
extern void push_labeled_block (tree);
extern tree prepare_eh_table_type (tree); extern tree prepare_eh_table_type (tree);
extern void java_expand_catch_classes (tree); extern void java_expand_catch_classes (tree);
extern tree build_exception_object_ref (tree); extern tree build_exception_object_ref (tree);
extern tree generate_name (void); extern tree generate_name (void);
extern void pop_labeled_block (void);
extern const char *lang_printable_name (tree, int); extern const char *lang_printable_name (tree, int);
extern tree maybe_add_interface (tree, tree); extern tree maybe_add_interface (tree, tree);
extern void set_super_info (int, tree, tree, int); extern void set_super_info (int, tree, tree, int);
...@@ -1666,16 +1664,6 @@ enum ...@@ -1666,16 +1664,6 @@ enum
#undef DEBUG_JAVA_BINDING_LEVELS #undef DEBUG_JAVA_BINDING_LEVELS
/* In a LABELED_BLOCK_EXPR node. */
#define LABELED_BLOCK_LABEL(NODE) \
TREE_OPERAND_CHECK_CODE (NODE, LABELED_BLOCK_EXPR, 0)
#define LABELED_BLOCK_BODY(NODE) \
TREE_OPERAND_CHECK_CODE (NODE, LABELED_BLOCK_EXPR, 1)
/* In an EXIT_BLOCK_EXPR node. */
#define EXIT_BLOCK_LABELED_BLOCK(NODE) \
TREE_OPERAND_CHECK_CODE (NODE, EXIT_BLOCK_EXPR, 0)
extern void java_genericize (tree); extern void java_genericize (tree);
extern int java_gimplify_expr (tree *, tree *, tree *); extern int java_gimplify_expr (tree *, tree *, tree *);
......
...@@ -721,10 +721,6 @@ java_tree_inlining_walk_subtrees (tree *tp ATTRIBUTE_UNUSED, ...@@ -721,10 +721,6 @@ java_tree_inlining_walk_subtrees (tree *tp ATTRIBUTE_UNUSED,
WALK_SUBTREE (BLOCK_EXPR_BODY (t)); WALK_SUBTREE (BLOCK_EXPR_BODY (t));
return NULL_TREE; return NULL_TREE;
case EXIT_BLOCK_EXPR:
*subtrees = 0;
return NULL_TREE;
default: default:
return NULL_TREE; return NULL_TREE;
} }
...@@ -906,15 +902,6 @@ java_dump_tree (void *dump_info, tree t) ...@@ -906,15 +902,6 @@ java_dump_tree (void *dump_info, tree t)
dump_child ("label", TREE_OPERAND (t, 0)); dump_child ("label", TREE_OPERAND (t, 0));
return true; return true;
case LABELED_BLOCK_EXPR:
dump_child ("label", LABELED_BLOCK_LABEL (t));
dump_child ("block", LABELED_BLOCK_BODY (t));
return true;
case EXIT_BLOCK_EXPR:
dump_child ("block", EXIT_BLOCK_LABELED_BLOCK (t));
return true;
case BLOCK: case BLOCK:
if (BLOCK_EXPR_BODY (t)) if (BLOCK_EXPR_BODY (t))
{ {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment