cleanup patch for java/decl.c

Per Bothner per@bothner.com
Thu Mar 15 21:32:00 GMT 2001


Many years ago (well, not that many) boys and girls, the java backend
was created by copying appropriate bits and pieces from the existing
backends.  Thus decl.c was copied with various fields and globals
that were useless for Java.  This patch (which I have checked in)
removes some that old crud.

2001-03-15  Per Bothner  <per@bothner.com>

	Remove junk from when gcc/java was created (by copying from C/C++).
	* decl.c (keep_next_level_flag, keep_next_if_subblocks):  Remove.
	(struct binding_level):  Remove fields keep, keep_if_subblocks,
	more_cleanups_ok, have_cleanups (which have never been used).
	(pushlevel, poplevel):  Remove related useless code.

Index: decl.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/java/decl.c,v
retrieving revision 1.92
diff -u -p -r1.92 decl.c
--- decl.c	2001/03/15 02:51:03	1.92
+++ decl.c	2001/03/16 04:33:37
@@ -276,18 +276,6 @@ struct binding_level
     /* The binding level which this one is contained in (inherits from).  */
     struct binding_level *level_chain;
 
-    /* 1 means make a BLOCK for this level regardless of all else.
-       2 for temporary binding contours created by the compiler.  */
-    char keep;
-
-    /* Nonzero means make a BLOCK if this level has any subblocks.  */
-    char keep_if_subblocks;
-
-    /* Nonzero if this level can safely have additional
-       cleanup-needing variables added to it.  */
-    char more_cleanups_ok;
-    char have_cleanups;
-
     /* The bytecode PC that marks the end of this level. */
     int end_pc;
     /* The bytecode PC that marks the start of this level. */
@@ -323,7 +311,7 @@ static struct binding_level *global_bind
 
 static struct binding_level clear_binding_level
   = {NULL_TREE, NULL_TREE, NULL_TREE, NULL_TREE,
-       NULL_BINDING_LEVEL, 0, 0, 0, 0, LARGEST_PC, 0};
+       NULL_BINDING_LEVEL, 0, LARGEST_PC};
 
 #if 0
 /* A list (chain of TREE_LIST nodes) of all LABEL_DECLs in the function
@@ -339,15 +327,6 @@ static tree shadowed_labels;
 
 int flag_traditional;
 
-/* Nonzero means unconditionally make a BLOCK for the next level pushed.  */
-
-static int keep_next_level_flag;
-
-/* Nonzero means make a BLOCK for the next level pushed
-   if it has subblocks.  */
-
-static int keep_next_if_subblocks;
-
 tree java_global_trees[JTI_MAX];
   
 tree predef_filenames[PREDEF_FILENAMES_SIZE];
@@ -1199,10 +1178,6 @@ pushlevel (unused)
   *newlevel = clear_binding_level;
   newlevel->level_chain = current_binding_level;
   current_binding_level = newlevel;
-  newlevel->keep = keep_next_level_flag;
-  keep_next_level_flag = 0;
-  newlevel->keep_if_subblocks = keep_next_if_subblocks;
-  keep_next_if_subblocks = 0;
 #if defined(DEBUG_JAVA_BINDING_LEVELS)
   newlevel->binding_depth = binding_depth;
   indent ();
@@ -1263,8 +1238,6 @@ poplevel (keep, reverse, functionbody)
 #endif
 #endif /* defined(DEBUG_JAVA_BINDING_LEVELS) */
 
-  keep |= current_binding_level->keep;
-
   /* Get the decls in the order they were written.
      Usually current_binding_level->names is in reverse order.
      But parameter decls were previously put in forward order.  */
@@ -1309,8 +1282,7 @@ poplevel (keep, reverse, functionbody)
   block_previously_created = (current_binding_level->this_block != 0);
   if (block_previously_created)
     block = current_binding_level->this_block;
-  else if (keep || functionbody
-	   || (current_binding_level->keep_if_subblocks && subblocks != 0))
+  else if (keep || functionbody)
     block = make_node (BLOCK);
   if (block != 0)
     {

-- 
	--Per Bothner
per@bothner.com   http://www.bothner.com/~per/



More information about the Gcc-patches mailing list