diff options
author | Jeff Sturm <jsturm@one-point.com> | 2003-09-03 13:44:43 +0000 |
---|---|---|
committer | Jeff Sturm <jsturm@gcc.gnu.org> | 2003-09-03 13:44:43 +0000 |
commit | 916b57cedabb2d80ac3e947a682efa3bce15cf4e (patch) | |
tree | 67c1212abb34f567ee45068cdd132021ed676e26 /gcc/java/decl.c | |
parent | e71d3aae3f8c92f18732e8cca0d07e0b2c31f814 (diff) | |
download | gcc-916b57cedabb2d80ac3e947a682efa3bce15cf4e.zip gcc-916b57cedabb2d80ac3e947a682efa3bce15cf4e.tar.gz gcc-916b57cedabb2d80ac3e947a682efa3bce15cf4e.tar.bz2 |
decl.c (java_expand_body): New function.
* decl.c (java_expand_body): New function.
* expr.c (build_class_init): Set DECL_IGNORED_P.
* java-tree.h (start_complete_expand_method,
java_expand_body): Declare.
* jcf-parse.c (cgraph.h): Include.
(java_parse_file): Handle flag_unit_at_a_time.
* lang.c (LANG_HOOKS_TREE_INLINING_START_INLINING,
LANG_HOOKS_CALLGRAPH_EXPAND_FUNCTION): Define.
(java_estimate_num_insns): Use walk_tree_without_duplicates.
(java_start_inlining): New function.
* parse.h (java_finish_classes): Declare.
* parse.y: Include cgraph.h.
(block): Don't special-case empty block production.
(craft_constructor): Set DECL_INLINE.
(source_end_java_method): Handle flag_unit_at_a_time.
Replace inline code with call to java_expand_body.
(start_complete_expand_method): Remove static modifier.
(java_expand_method_bodies): Patch function tree for
class initialization and/or synchronization as needed.
Don't begin RTL expansion yet.
(java_expand_classes): Check flag_unit_at_a_time before
calling finish_class.
(java_finish_classes): New function.
(java_complete_lhs): Ensure COMPOUND_EXPR has non-NULL type.
(patch_assignment): Set DECL_CONTEXT on temporary variable.
(emit_test_initialization): Set DECL_IGNORED_P.
From-SVN: r71024
Diffstat (limited to 'gcc/java/decl.c')
-rw-r--r-- | gcc/java/decl.c | 53 |
1 files changed, 53 insertions, 0 deletions
diff --git a/gcc/java/decl.c b/gcc/java/decl.c index c1cebd8..90978e4 100644 --- a/gcc/java/decl.c +++ b/gcc/java/decl.c @@ -1811,6 +1811,59 @@ end_java_method (void) current_function_decl = NULL_TREE; } +/* Expand a function's body. */ + +void +java_expand_body (tree fndecl) +{ + const char *saved_input_filename = input_filename; + int saved_lineno = input_line; + + current_function_decl = fndecl; + input_filename = DECL_SOURCE_FILE (fndecl); + input_line = DECL_SOURCE_LINE (fndecl); + + timevar_push (TV_EXPAND); + + /* Prepare the function for tree completion. */ + start_complete_expand_method (fndecl); + + if (! flag_emit_class_files && ! flag_emit_xref) + { + /* Initialize the RTL code for the function. */ + init_function_start (fndecl); + + /* Set up parameters and prepare for return, for the function. */ + expand_function_start (fndecl, 0); + + /* Generate the RTL for this function. */ + expand_expr_stmt_value (DECL_SAVED_TREE (fndecl), 0, 1); + } + + /* Pop out of its parameters. */ + pushdecl_force_head (DECL_ARGUMENTS (fndecl)); + poplevel (1, 0, 1); + BLOCK_SUPERCONTEXT (DECL_INITIAL (fndecl)) = fndecl; + + if (! flag_emit_class_files && ! flag_emit_xref) + { + /* Generate RTL for function exit. */ + input_line = DECL_FUNCTION_LAST_LINE (fndecl); + expand_function_end (); + + /* Run the optimizers and output the assembler code + for this function. */ + rest_of_compilation (fndecl); + } + + timevar_pop (TV_EXPAND); + + input_filename = saved_input_filename; + input_line = saved_lineno; + + current_function_decl = NULL_TREE; +} + /* Dump FUNCTION_DECL FN as tree dump PHASE. */ static void |