This is the mail archive of the java-patches@gcc.gnu.org mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Patch: FYI: remove useless flags from gcj


I'm checking this in.

This removes some pointless flags from gcj.  flag_extraneous_semicolon
and flag_redundant are only used by ecj1.  We no longer generate
.class files, so flag_emit_class_files is useless.
flag_not_overriding and flag_static_local_jdk1_1 are completely
unused, I don't remember if they ever were.

Bootstrapped on x86 FC 5.

There's still more dead code in gcj.  Eventually I'll get it all out.

Tom

Index: ChangeLog
from  Tom Tromey  <tromey@redhat.com>

	* typeck.c (convert): Don't use flag_emit_class_files.
	* lang.c (java_post_options): Don't use flag_emit_class_files.
	(java_handle_option): Don't use flag_extraneous_semicolon or
	flag_redundant.
	* jcf-parse.c (HANDLE_CONSTANTVALUE): Don't use
	flag_emit_class_files.
	(load_class): Likewise.
	* java-tree.h (flag_emit_class_files): Don't declare.
	(STATIC_CLASS_INIT_OPT_P): Don't use flag_emit_class_files.
	(flag_extraneous_semicolon): Don't declare.
	(flag_not_overriding): Likewise.
	(flag_static_local_jdk1_1): Likewise.
	(flag_redundant): Likewise.
	* expr.c (build_newarray): Don't use flag_emit_class_files.
	* class.c (DEFAULT_ENABLE_ASSERT): Don't use
	flag_emit_class_files.
	(build_class_ref): Likewise.
	* builtins.c (check_for_builtin): Don't use
	flag_emit_class_files.

Index: typeck.c
===================================================================
--- typeck.c	(revision 120682)
+++ typeck.c	(working copy)
@@ -1,5 +1,5 @@
 /* Handle types for the GNU compiler for the Java(TM) language.
-   Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005
+   Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, 2007
    Free Software Foundation, Inc.
 
 This file is part of GCC.
@@ -131,9 +131,7 @@
     {
       if (type == char_type_node || type == promoted_char_type_node)
 	return fold_convert (type, expr);
-      if ((really_constant_p (expr)
-	   || (! flag_unsafe_math_optimizations
-	       && ! flag_emit_class_files))
+      if ((really_constant_p (expr) || ! flag_unsafe_math_optimizations)
 	  && TREE_CODE (TREE_TYPE (expr)) == REAL_TYPE
 	  && TARGET_FLOAT_FORMAT == IEEE_FLOAT_FORMAT)
 	return convert_ieee_real_to_integer (type, expr);
Index: class.c
===================================================================
--- class.c	(revision 120682)
+++ class.c	(working copy)
@@ -209,7 +209,7 @@
 
 /* The default value returned by enable_assertions. */
 
-#define DEFAULT_ENABLE_ASSERT (flag_emit_class_files || optimize == 0)
+#define DEFAULT_ENABLE_ASSERT (optimize == 0)
 
 /* Enter IDENT (a class or package name) into the enable-assertions table.
    VALUE is true to enable and false to disable. */
@@ -1059,40 +1059,6 @@
 	  const char *name;
 	  tree decl_name;
 	  char buffer[25];
-	  if (flag_emit_class_files)
-	    {
-	      const char *prim_class_name;
-	      tree prim_class;
-	      if (type == char_type_node)
-		prim_class_name = "java.lang.Character";
-	      else if (type == boolean_type_node)
-		prim_class_name = "java.lang.Boolean";
-	      else if (type == byte_type_node)
-		prim_class_name = "java.lang.Byte";
-	      else if (type == short_type_node)
-		prim_class_name = "java.lang.Short";
-	      else if (type == int_type_node)
-		prim_class_name = "java.lang.Integer";
-	      else if (type == long_type_node)
-		prim_class_name = "java.lang.Long";
-	      else if (type == float_type_node)
-                prim_class_name = "java.lang.Float";
-	      else if (type == double_type_node)
-                prim_class_name = "java.lang.Double";
-	      else if (type == void_type_node)
-                prim_class_name = "java.lang.Void";
-	      else
-		gcc_unreachable ();
-
-	      prim_class = lookup_class (get_identifier (prim_class_name));
-	      /* We wrap the class in a NOP_EXPR, because it is a
-	         type.  We can't hold it in the COMPONENT_REF itself,
-	         as that type must remain NULL.  */
-	      prim_class = build1 (NOP_EXPR, prim_class, NULL_TREE);
-	      
-	      return build3 (COMPONENT_REF, NULL_TREE,
-			     prim_class, TYPE_identifier_node, NULL_TREE);
-	    }
 	  decl_name = TYPE_NAME (type);
 	  if (TREE_CODE (decl_name) == TYPE_DECL)
 	    decl_name = DECL_NAME (decl_name);
Index: jcf-parse.c
===================================================================
--- jcf-parse.c	(revision 120682)
+++ jcf-parse.c	(working copy)
@@ -912,7 +912,7 @@
 
 #define HANDLE_CONSTANTVALUE(INDEX) \
 { tree constant;  int index = INDEX; \
-  if (! flag_emit_class_files && JPOOL_TAG (jcf, index) == CONSTANT_String) { \
+  if (JPOOL_TAG (jcf, index) == CONSTANT_String) { \
     tree name = get_name_constant (jcf, JPOOL_USHORT1 (jcf, index)); \
     constant = build_utf8_ref (name); \
   } \
@@ -1469,8 +1469,7 @@
   
   if (!class_loaded)
     {
-      if (flag_verify_invocations || ! flag_indirect_dispatch
-	  || flag_emit_class_files)
+      if (flag_verify_invocations || ! flag_indirect_dispatch)
 	{
 	  if (verbose)
 	    error ("cannot find file for class %s", IDENTIFIER_POINTER (saved));
Index: builtins.c
===================================================================
--- builtins.c	(revision 120682)
+++ builtins.c	(working copy)
@@ -1,5 +1,5 @@
 /* Built-in and inline functions for gcj
-   Copyright (C) 2001, 2003, 2004, 2005, 2006
+   Copyright (C) 2001, 2003, 2004, 2005, 2006, 2007
    Free Software Foundation, Inc.
 
 This file is part of GCC.
@@ -578,7 +578,7 @@
 tree
 check_for_builtin (tree method, tree call)
 {
-  if (! flag_emit_class_files && optimize && TREE_CODE (call) == CALL_EXPR)
+  if (optimize && TREE_CODE (call) == CALL_EXPR)
     {
       int i;
       tree method_arguments = TREE_OPERAND (call, 1);
Index: expr.c
===================================================================
--- expr.c	(revision 120682)
+++ expr.c	(working copy)
@@ -1059,13 +1059,9 @@
 			     host_integerp (length, 0) == INTEGER_CST
 			     ? tree_low_cst (length, 0) : -1);
 
-  /* If compiling to native, pass a reference to the primitive type class 
-     and save the runtime some work. However, the bytecode generator
-     expects to find the type_code int here. */
-  if (flag_emit_class_files)
-    type_arg = build_int_cst (NULL_TREE, atype_value);
-  else
-    type_arg = build_class_ref (prim_type);
+  /* Pass a reference to the primitive type class and save the runtime
+     some work.  */
+  type_arg = build_class_ref (prim_type);
 
   return build3 (CALL_EXPR, promote_type (type),
 		 build_address_of (soft_newarray_node),
Index: lang.c
===================================================================
--- lang.c	(revision 120682)
+++ lang.c	(working copy)
@@ -270,8 +270,6 @@
 
     case OPT_Wall:
       flag_wall = value;
-      flag_redundant = value;
-      flag_extraneous_semicolon = value;
       /* When -Wall given, enable -Wunused.  We do this because the C
 	 compiler does it, and people expect it.  */
       set_Wunused (value);
@@ -657,8 +655,6 @@
 		     target name here.  */
 		  if ((dependency_tracking & DEPEND_TARGET_SET))
 		    ; /* Nothing.  */
-		  else if (flag_emit_class_files)
-		    jcf_dependency_set_target (NULL);
 		  else
 		    {
 		      strcpy (buf + (dot - filename), TARGET_OBJECT_SUFFIX);
Index: java-tree.h
===================================================================
--- java-tree.h	(revision 120682)
+++ java-tree.h	(working copy)
@@ -131,8 +131,6 @@
 /* The virtual offset symbol table. Used by the runtime to fill out
    the otable. */
 
-extern int flag_emit_class_files;
-
 extern int flag_filelist_file;
 
 /* When nonzero, permit the use of the assert keyword.  */
@@ -144,10 +142,6 @@
 
 extern int flag_jni;
 
-/* When nonzero, report the now deprecated empty statements.  */
-
-extern int flag_extraneous_semicolon;
-
 /* When nonzero, always check for a non gcj generated classes archive.  */
 
 extern int flag_force_classes_archive_check;
@@ -158,8 +152,6 @@
 /* Turned to 1 if -Wall was encountered. See lang.c for their meanings.  */
 extern int flag_wall;
 extern int flag_redundant;
-extern int flag_not_overriding;
-extern int flag_static_local_jdk1_1;
 
 /* When nonzero, warn when source file is newer than matching class
    file.  */
@@ -1674,7 +1666,7 @@
 
 /* True when we can perform static class initialization optimization */
 #define STATIC_CLASS_INIT_OPT_P() \
-  (flag_optimize_sci && (optimize >= 2) && ! flag_emit_class_files)
+  (flag_optimize_sci && (optimize >= 2))
 
 /* These are the possible values for the `state' field of the class
    structure.  This must be kept in sync with libgcj.  */


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]