diff --git a/gcc/java/ChangeLog b/gcc/java/ChangeLog index 514c097..93eb1c2 100644 --- a/gcc/java/ChangeLog +++ b/gcc/java/ChangeLog @@ -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. diff --git a/gcc/java/decl.c b/gcc/java/decl.c index 858e082..074a093 100644 --- a/gcc/java/decl.c +++ b/gcc/java/decl.c @@ -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. */ diff --git a/gcc/java/java-tree.h b/gcc/java/java-tree.h index 69eb73c..8f52428 100644 --- a/gcc/java/java-tree.h +++ b/gcc/java/java-tree.h @@ -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); diff --git a/gcc/java/jcf-parse.c b/gcc/java/jcf-parse.c index f47dbe0..9f4beb5 100644 --- a/gcc/java/jcf-parse.c +++ b/gcc/java/jcf-parse.c @@ -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 (); diff --git a/gcc/java/parse.y b/gcc/java/parse.y index ebcf680..3b38a1e 100644 --- a/gcc/java/parse.y +++ b/gcc/java/parse.y @@ -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); } } }