This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[tuples] java: make it build
- From: Aldy Hernandez <aldyh at redhat dot com>
- To: dnovillo at google dot com, gcc-patches at gcc dot gnu dot org
- Date: Mon, 26 Nov 2007 14:52:05 -0400
- Subject: [tuples] java: make it build
This patch tuplifies the Java front-end.
Looks like Java's pretty clean; not much to do.
Committed to branch.
* gimple.h (gimple_bind_block): Update comment.
* java-gimplify.c (java_gimplify_expr): Make pre_p and post_p
sequences.
(java_gimplify_self_mod_expr): Same.
Handl BIND_EXPRs correctly with regards to tuples.
* java-tree.h (java_gimplify_expr): Make pre_p and post_p
sequences.
Index: java/java-gimplify.c
===================================================================
--- java/java-gimplify.c (revision 130377)
+++ java/java-gimplify.c (working copy)
@@ -33,7 +33,7 @@ The Free Software Foundation is independ
static tree java_gimplify_block (tree);
static enum gimplify_status java_gimplify_modify_expr (tree *);
-static enum gimplify_status java_gimplify_self_mod_expr (tree*, tree*, tree *);
+static enum gimplify_status java_gimplify_self_mod_expr (tree *, gimple_seq, gimple_seq);
static void dump_java_tree (enum tree_dump_index, tree);
@@ -53,8 +53,8 @@ java_genericize (tree fndecl)
/* Gimplify a Java tree. */
int
-java_gimplify_expr (tree *expr_p, tree *pre_p ATTRIBUTE_UNUSED,
- tree *post_p ATTRIBUTE_UNUSED)
+java_gimplify_expr (tree *expr_p, gimple_seq pre_p ATTRIBUTE_UNUSED,
+ gimple_seq post_p ATTRIBUTE_UNUSED)
{
enum tree_code code = TREE_CODE (*expr_p);
@@ -160,8 +160,8 @@ java_gimplify_modify_expr (tree *modify_
between the reading and the writing. */
static enum gimplify_status
-java_gimplify_self_mod_expr (tree *expr_p, tree *pre_p ATTRIBUTE_UNUSED,
- tree *post_p ATTRIBUTE_UNUSED)
+java_gimplify_self_mod_expr (tree *expr_p, gimple_seq pre_p ATTRIBUTE_UNUSED,
+ gimple_seq post_p ATTRIBUTE_UNUSED)
{
tree lhs = TREE_OPERAND (*expr_p, 0);
@@ -180,7 +180,7 @@ java_gimplify_block (tree java_block)
{
tree decls = BLOCK_VARS (java_block);
tree body = BLOCK_EXPR_BODY (java_block);
- tree outer = gimple_current_bind_expr ();
+ gimple outer = gimple_current_bind_expr ();
tree block;
/* Don't bother with empty blocks. */
@@ -199,10 +199,10 @@ java_gimplify_block (tree java_block)
routines generate info for the variables in that block. */
TREE_USED (block) = 1;
- if (outer != NULL_TREE)
+ if (outer != NULL)
{
- outer = BIND_EXPR_BLOCK (outer);
- BLOCK_SUBBLOCKS (outer) = chainon (BLOCK_SUBBLOCKS (outer), block);
+ tree b = gimple_bind_block (outer);
+ BLOCK_SUBBLOCKS (b) = chainon (BLOCK_SUBBLOCKS (b), block);
}
BLOCK_EXPR_BODY (java_block) = NULL_TREE;
Index: java/java-tree.h
===================================================================
--- java/java-tree.h (revision 130377)
+++ java/java-tree.h (working copy)
@@ -1566,7 +1566,7 @@ enum
#undef DEBUG_JAVA_BINDING_LEVELS
extern void java_genericize (tree);
-extern int java_gimplify_expr (tree *, tree *, tree *);
+extern int java_gimplify_expr (tree *, gimple_seq, gimple_seq);
extern FILE *finput;
Index: gimple.h
===================================================================
--- gimple.h (revision 130377)
+++ gimple.h (working copy)
@@ -1429,7 +1429,7 @@ gimple_bind_set_body (gimple gs, const_g
/* Return the TREE_BLOCK node associated with GIMPLE_BIND statement
- GS. */
+ GS. This is analogous to the BIND_EXPR_BLOCK field in trees. */
static inline tree
gimple_bind_block (const_gimple gs)