decl.c (java_optimize_inline, [...]): Remove.
authorJeff Sturm <jsturm@one-point.com>
Sun, 28 Sep 2003 13:23:12 +0000 (13:23 +0000)
committerJeff Sturm <jsturm@gcc.gnu.org>
Sun, 28 Sep 2003 13:23:12 +0000 (13:23 +0000)
* decl.c (java_optimize_inline, dump_function): Remove.
* java-tree.h (java_optimize_inline): Remove declaration.
* jcf-parse.c (java_parse_file): Assume flag_unit_at_a_time is set.
* parse.y (source_end_java_method, java_expand_classes):
Likewise.  Remove dead code.

From-SVN: r71882

gcc/java/ChangeLog
gcc/java/decl.c
gcc/java/java-tree.h
gcc/java/jcf-parse.c
gcc/java/parse.y

index 514c0978188710c70dd3c7b0049dd3e3b5de9e07..93eb1c2d1d18685b68ca5aea49efda6ef66e76a2 100644 (file)
@@ -1,3 +1,11 @@
+2003-09-28  Jeff Sturm  <jsturm@one-point.com>
+
+       * decl.c (java_optimize_inline, dump_function): Remove.
+       * java-tree.h (java_optimize_inline): Remove declaration.
+       * jcf-parse.c (java_parse_file): Assume flag_unit_at_a_time is set.
+       * parse.y (source_end_java_method, java_expand_classes):
+       Likewise.  Remove dead code.
+
 2003-09-27  Roger Sayle  <roger@eyesopen.com>
 
        * lang.c (java_init_options): Set flag_evaluation_order.
index 858e0820ac6c80396344a89252237fd0549bd99f..074a093198408d2a6d3da20934a9a0ec3ac810c3 100644 (file)
@@ -57,7 +57,6 @@ static struct binding_level *make_binding_level (void);
 static tree create_primitive_vtable (const char *);
 static tree check_local_named_variable (tree, tree, int, int *);
 static tree check_local_unnamed_variable (tree, tree, tree);
-static void dump_function (enum tree_dump_index, tree);
 
 /* Name of the Cloneable class.  */
 tree java_lang_cloneable_identifier_node;
@@ -1865,33 +1864,6 @@ java_expand_body (tree fndecl)
   current_function_decl = NULL_TREE;
 }
 
-/* Dump FUNCTION_DECL FN as tree dump PHASE. */
-
-static void
-dump_function (enum tree_dump_index phase, tree fn)
-{
-  FILE *stream;
-  int flags;
-
-  stream = dump_begin (phase, &flags);
-  if (stream)
-    {
-      dump_node (fn, TDF_SLIM | flags, stream);
-      dump_end (phase, stream);
-    }
-}
-void java_optimize_inline (tree fndecl)
-{
-  if (flag_inline_trees)
-    {
-      timevar_push (TV_INTEGRATION);
-      optimize_inline_calls (fndecl);
-      timevar_pop (TV_INTEGRATION);
-      dump_function (TDI_inlined, fndecl);
-    }
-}
-
 /* We pessimistically marked all methods and fields external until we
    knew what set of classes we were planning to compile.  Now mark those
    associated with CLASS to be generated locally as not external.  */
index 69eb73c3784334ee32ad7d4e9a890f81034a1695..8f524284c486867d81b33d21e273f339303a5af8 100644 (file)
@@ -1281,7 +1281,6 @@ extern void append_gpp_mangled_name (const char *, int);
 extern void add_predefined_file (tree);
 extern int predefined_filename_p (tree);
 
-extern void java_optimize_inline (tree);
 extern tree decl_constant_value (tree);
 
 extern void java_mark_class_local (tree);
index f47dbe0897a27e020468402508877500c7031214..9f4beb5b3a3cfebe01a28c39fd64627e9992c93e 100644 (file)
@@ -1120,13 +1120,12 @@ java_parse_file (int set_yydebug ATTRIBUTE_UNUSED)
   java_expand_classes ();
   if (!java_report_errors () && !flag_syntax_only)
     {
-      if (flag_unit_at_a_time)
-       {
-         cgraph_finalize_compilation_unit ();
-         cgraph_optimize ();
-         java_finish_classes ();
-       }
+      /* Optimize and expand all classes compiled from source.  */
+      cgraph_finalize_compilation_unit ();
+      cgraph_optimize ();
+      java_finish_classes ();
 
+      /* Emit the .jcf section.  */
       emit_register_classes ();
       if (flag_indirect_dispatch)
        emit_offset_symbol_table ();
index ebcf6800128a0049dea7b71984693eb7c5977759..3b38a1eb3bf6de35f891af8473bd1334a67af5c8 100644 (file)
@@ -7484,20 +7484,11 @@ source_end_java_method (void)
      patched.  Dump it to a file if the user requested it.  */
   dump_java_tree (TDI_original, fndecl);
 
-  /* In unit-at-a-time mode, don't expand the method yet.  */
-  if (DECL_SAVED_TREE (fndecl) && flag_unit_at_a_time)
-    {
-      cgraph_finalize_function (fndecl, false);
-      current_function_decl = NULL_TREE;
-      java_parser_context_restore_global ();
-      return;
-    }
-
-  java_optimize_inline (fndecl);
-
-  /* Expand the function's body.  */
-  java_expand_body (fndecl);
+  /* Defer expanding the method until cgraph analysis is complete.  */
+  if (DECL_SAVED_TREE (fndecl))
+    cgraph_finalize_function (fndecl, false);
 
+  current_function_decl = NULL_TREE;
   java_parser_context_restore_global ();
 }
 
@@ -9157,11 +9148,7 @@ java_expand_classes (void)
          if (flag_emit_xref)
            expand_xref (current_class);
          else if (! flag_syntax_only)
-           {
-             java_expand_method_bodies (current_class);
-             if (!flag_unit_at_a_time)
-               finish_class ();
-           }
+           java_expand_method_bodies (current_class);
        }
     }
 }