diff options
author | Jan Hubicka <jh@suse.cz> | 2007-04-24 00:05:57 +0000 |
---|---|---|
committer | Jan Hubicka <hubicka@gcc.gnu.org> | 2007-04-24 00:05:57 +0000 |
commit | ec9ac2bc429d48bfd2466d56ddea4244ebfba990 (patch) | |
tree | 19aa53b591348882b9111f4982435cf750d2b3f5 /gcc/function.c | |
parent | edc5f63bf6f3be7c7288a1692734f08c88cc13b8 (diff) | |
download | gcc-ec9ac2bc429d48bfd2466d56ddea4244ebfba990.zip gcc-ec9ac2bc429d48bfd2466d56ddea4244ebfba990.tar.gz gcc-ec9ac2bc429d48bfd2466d56ddea4244ebfba990.tar.bz2 |
Revert:
2007-04-23 Jan Hubicka <jh@suse.cz>
* function.c (init_function_start): Don't init line number info.
(expand_function_end): Update.
(reset_block_changes, record_block_change, finalize_block_changes,
check_block_change, free_block_changes): Kill.
* function.h (reset_block_changes, record_block_change,
finalize_block_changes, check_block_change, free_block_changes): Remove
prototypes.
(struct function): Remove ib_boundaries_block.
* emit-rtl.c (make_insn_raw, make_jump_insn_raw, make_call_insn_raw):
Use curr_insn_locator to initialize locator.
(emit_line_note): Remove.
* cfgexpand.c (expand_gimple_cond_expr): Update.
(construct_exit_block): Likewise.
(tree_expand_cfg): Initialize/finalize locators.
* expr.c (expand_expr_real): Update.
* cfglayout.c (line_locators_locs, line_locators_lines,
file_locators_locs, file_locators_files): Remove.
(set_block_levels): Move to cfgexpand.c.
(insn_locators_initialize): Remove.
(pass_insn_locators_initialize): Remove.
(locations_locators_locs, locations_locators_vals): New static vars.
(curr_location, last_location, curr_block, last_block, curr_rtl_loc):
Likewise.
(insn_locators_alloc, insn_locators_finalize,
set_curr_insn_source_location, set_curr_insn_block, curr_insn_locator):
New functions.
(locator_location): New.
(locator_line, locator_file): Rewrite.
* rtl.h (emit_line_note): Kill.
(insn_locators_alloc, insn_locators_finalize,
set_curr_insn_source_location, set_curr_insn_block, curr_insn_locator):
Declare.
* tree-inline.c (initialize_cfun): Do not initialize
ib_boundaries_block.
* passes.c (pass_insn_locators_initialize): Remove.
From-SVN: r124094
Diffstat (limited to 'gcc/function.c')
-rw-r--r-- | gcc/function.c | 70 |
1 files changed, 69 insertions, 1 deletions
diff --git a/gcc/function.c b/gcc/function.c index 7004793..f0a2dd6 100644 --- a/gcc/function.c +++ b/gcc/function.c @@ -3843,6 +3843,18 @@ init_function_start (tree subr) { prepare_function_start (subr); + /* Prevent ever trying to delete the first instruction of a + function. Also tell final how to output a linenum before the + function prologue. Note linenums could be missing, e.g. when + compiling a Java .class file. */ + if (! DECL_IS_BUILTIN (subr)) + emit_line_note (DECL_SOURCE_LOCATION (subr)); + + /* Make sure first insn is a note even if we don't want linenums. + This makes sure the first insn will never be deleted. + Also, final expects a note to appear there. */ + emit_note (NOTE_INSN_DELETED); + /* Warn if this value is an aggregate type, regardless of which calling convention we are using for it. */ if (AGGREGATE_TYPE_P (TREE_TYPE (DECL_RESULT (subr)))) @@ -4293,7 +4305,7 @@ expand_function_end (void) /* Output a linenumber for the end of the function. SDB depends on this. */ force_next_line_note (); - set_curr_insn_source_location (input_location); + emit_line_note (input_location); /* Before the return label (if any), clobber the return registers so that they are not propagated live to the rest of @@ -5336,6 +5348,62 @@ reposition_prologue_and_epilogue_notes (rtx f ATTRIBUTE_UNUSED) #endif /* HAVE_prologue or HAVE_epilogue */ } +/* Resets insn_block_boundaries array. */ + +void +reset_block_changes (void) +{ + cfun->ib_boundaries_block = VEC_alloc (tree, gc, 100); + VEC_quick_push (tree, cfun->ib_boundaries_block, NULL_TREE); +} + +/* Record the boundary for BLOCK. */ +void +record_block_change (tree block) +{ + int i, n; + tree last_block; + + if (!block) + return; + + if(!cfun->ib_boundaries_block) + return; + + last_block = VEC_pop (tree, cfun->ib_boundaries_block); + n = get_max_uid (); + for (i = VEC_length (tree, cfun->ib_boundaries_block); i < n; i++) + VEC_safe_push (tree, gc, cfun->ib_boundaries_block, last_block); + + VEC_safe_push (tree, gc, cfun->ib_boundaries_block, block); +} + +/* Finishes record of boundaries. */ +void +finalize_block_changes (void) +{ + record_block_change (DECL_INITIAL (current_function_decl)); +} + +/* For INSN return the BLOCK it belongs to. */ +void +check_block_change (rtx insn, tree *block) +{ + unsigned uid = INSN_UID (insn); + + if (uid >= VEC_length (tree, cfun->ib_boundaries_block)) + return; + + *block = VEC_index (tree, cfun->ib_boundaries_block, uid); +} + +/* Releases the ib_boundaries_block records. */ +void +free_block_changes (void) +{ + VEC_free (tree, gc, cfun->ib_boundaries_block); +} + /* Returns the name of the current function. */ const char * current_function_name (void) |