aboutsummaryrefslogtreecommitdiff
path: root/gcc/cfgexpand.c
diff options
context:
space:
mode:
authorJan Hubicka <jh@suse.cz>2007-04-24 00:05:57 +0000
committerJan Hubicka <jh@suse.cz>2007-04-24 00:05:57 +0000
commitc0be249e4f83f4faa0715857be4ec12bb1349600 (patch)
tree19aa53b591348882b9111f4982435cf750d2b3f5 /gcc/cfgexpand.c
parent07609fd00b14dbf7b3c874b24be990548646ea6a (diff)
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. git-svn-id: https://gcc.gnu.org/svn/gcc/trunk@124094 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/cfgexpand.c')
-rw-r--r--gcc/cfgexpand.c44
1 files changed, 10 insertions, 34 deletions
diff --git a/gcc/cfgexpand.c b/gcc/cfgexpand.c
index 23cf4477ed4..ab2b9d36af2 100644
--- a/gcc/cfgexpand.c
+++ b/gcc/cfgexpand.c
@@ -1265,8 +1265,8 @@ expand_gimple_cond_expr (basic_block bb, tree stmt)
extract_true_false_edges_from_block (bb, &true_edge, &false_edge);
if (EXPR_LOCUS (stmt))
{
- set_curr_insn_source_location (*(EXPR_LOCUS (stmt)));
- set_curr_insn_block (TREE_BLOCK (stmt));
+ emit_line_note (*(EXPR_LOCUS (stmt)));
+ record_block_change (TREE_BLOCK (stmt));
}
/* These flags have no purpose in RTL land. */
@@ -1281,7 +1281,7 @@ expand_gimple_cond_expr (basic_block bb, tree stmt)
add_reg_br_prob_note (last, true_edge->probability);
maybe_dump_rtl_for_tree_stmt (stmt, last);
if (EXPR_LOCUS (then_exp))
- set_curr_insn_source_location (*(EXPR_LOCUS (then_exp)));
+ emit_line_note (*(EXPR_LOCUS (then_exp)));
return NULL;
}
if (TREE_CODE (else_exp) == GOTO_EXPR && IS_EMPTY_STMT (then_exp))
@@ -1290,7 +1290,7 @@ expand_gimple_cond_expr (basic_block bb, tree stmt)
add_reg_br_prob_note (last, false_edge->probability);
maybe_dump_rtl_for_tree_stmt (stmt, last);
if (EXPR_LOCUS (else_exp))
- set_curr_insn_source_location (*(EXPR_LOCUS (else_exp)));
+ emit_line_note (*(EXPR_LOCUS (else_exp)));
return NULL;
}
gcc_assert (TREE_CODE (then_exp) == GOTO_EXPR
@@ -1322,7 +1322,7 @@ expand_gimple_cond_expr (basic_block bb, tree stmt)
maybe_dump_rtl_for_tree_stmt (stmt, last2);
if (EXPR_LOCUS (else_exp))
- set_curr_insn_source_location (*(EXPR_LOCUS (else_exp)));
+ emit_line_note (*(EXPR_LOCUS (else_exp)));
return new_bb;
}
@@ -1613,19 +1613,6 @@ construct_init_block (void)
return init_block;
}
-/* For each lexical block, set BLOCK_NUMBER to the depth at which it is
- found in the block tree. */
-
-static void
-set_block_levels (tree block, int level)
-{
- while (block)
- {
- BLOCK_NUMBER (block) = level;
- set_block_levels (BLOCK_SUBBLOCKS (block), level + 1);
- block = BLOCK_CHAIN (block);
- }
-}
/* Create a block containing landing pads and similar stuff. */
@@ -1650,7 +1637,7 @@ construct_exit_block (void)
input_location = cfun->function_end_locus;
/* The following insns belong to the top scope. */
- set_curr_insn_block (DECL_INITIAL (current_function_decl));
+ record_block_change (DECL_INITIAL (current_function_decl));
/* Generate rtl for function exit. */
expand_function_end ();
@@ -1778,16 +1765,8 @@ tree_expand_cfg (void)
/* Some backends want to know that we are expanding to RTL. */
currently_expanding_to_rtl = 1;
- insn_locators_alloc ();
- if (!DECL_BUILT_IN (current_function_decl))
- set_curr_insn_source_location (DECL_SOURCE_LOCATION (current_function_decl));
- set_curr_insn_block (DECL_INITIAL (current_function_decl));
- prologue_locator = curr_insn_locator ();
-
- /* 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);
+ /* Prepare the rtl middle end to start recording block changes. */
+ reset_block_changes ();
/* Mark arrays indexed with non-constant indices with TREE_ADDRESSABLE. */
discover_nonconstant_array_refs ();
@@ -1834,8 +1813,6 @@ tree_expand_cfg (void)
bb = expand_gimple_basic_block (bb);
construct_exit_block ();
- set_curr_insn_block (DECL_INITIAL (current_function_decl));
- insn_locators_finalize ();
/* We're done expanding trees to RTL. */
currently_expanding_to_rtl = 0;
@@ -1866,6 +1843,8 @@ tree_expand_cfg (void)
more CONCATs anywhere. */
generating_concat_p = 0;
+ finalize_block_changes ();
+
if (dump_file)
{
fprintf (dump_file,
@@ -1896,9 +1875,6 @@ tree_expand_cfg (void)
return_label = NULL;
naked_return_label = NULL;
free_histograms ();
- /* Tag the blocks with a depth number so that change_scope can find
- the common parent easily. */
- set_block_levels (DECL_INITIAL (cfun->decl), 0);
return 0;
}