aboutsummaryrefslogtreecommitdiff
path: root/gcc/stmt.c
diff options
context:
space:
mode:
authorMark Mitchell <mark@codesourcery.com>1999-12-16 17:50:29 +0000
committerMark Mitchell <mmitchel@gcc.gnu.org>1999-12-16 17:50:29 +0000
commita97901e608d0e3233e28a6d8e39d3124d661a650 (patch)
tree0e496457c98d2aabb71fdf3add8cb1bb884dc210 /gcc/stmt.c
parent0d9484c5ad47e319a075c5c091634b8adc3b9412 (diff)
downloadgcc-a97901e608d0e3233e28a6d8e39d3124d661a650.zip
gcc-a97901e608d0e3233e28a6d8e39d3124d661a650.tar.gz
gcc-a97901e608d0e3233e28a6d8e39d3124d661a650.tar.bz2
Makefile.in (INTREGRATE_H): Rename to INTEGRATE_H.
* Makefile.in (INTREGRATE_H): Rename to INTEGRATE_H. * function.c (insert_block_after_note): Remove. (retrofit_block): Likewise. (identify_blocks): Fix indentation. (reorder_blocks): Don't NULL out NOTE_SOURCE_FILE for a NOTE_INSN_BLOCK_BEG or NOTE_INSN_BLOCK_END. * function.h (insert_block_after_note): Remove prototype. (retrofit_block): Likewise. * integrate.c (expand_inline_function): Don't call find_loop_tree_blocks. Use expand_start_bindings_and_block, not just expand_start_bindings. Use the block_map to remap old NOTE_BLOCKs to new ones. (integrate_decl_tree): Keep track of remapped blocks. * integrate.h (struct inline_remap): Add block_map. * stmt.c (expand_fixup): Don't try to retrofit_blocks. Just set NOTE_BLOCK on the notes. (expand_start_bindings): Rename to ... (expand_start_bindings_and_block): Add parameter. Set NOTE_BLOCK. (expand_end_bindings): Set NOTE_BLOCK. * toplev.c (rest_of_compilation): In function-at-a-time-mode, reconstruct the BLOCK tree. * tree.h (expand_start_bindings): Macroize. Call ... (expand_start_bindings_and_block): New function. * optimize.c (struct inline_data): Remove scope_stmt. (remap_block): Don't use insert_block_after_note. Don't update scope_stmt. (expand_call_inline): Don't update scope_stmt. (optimize_function): Don't initialize scope_stmt. * semantics.c (expand_stmt): Set NOTE_BLOCK for newly emitted NOTE_INSN_BLOCK_BEG/NOTE_INSN_BLOCK_END notes. From-SVN: r30982
Diffstat (limited to 'gcc/stmt.c')
-rw-r--r--gcc/stmt.c50
1 files changed, 38 insertions, 12 deletions
diff --git a/gcc/stmt.c b/gcc/stmt.c
index e94c1e8..826295b 100644
--- a/gcc/stmt.c
+++ b/gcc/stmt.c
@@ -1024,23 +1024,30 @@ expand_fixup (tree_label, rtl_label, last_insn)
register rtx original_before_jump
= last_insn ? last_insn : get_last_insn ();
rtx start;
+ rtx end;
tree block;
block = make_node (BLOCK);
TREE_USED (block) = 1;
- if (current_function->x_whole_function_mode_p)
+ if (!current_function->x_whole_function_mode_p)
+ insert_block (block);
+ else
{
- find_loop_tree_blocks ();
- retrofit_block (block, original_before_jump);
+ BLOCK_CHAIN (block)
+ = BLOCK_CHAIN (DECL_INITIAL (current_function_decl));
+ BLOCK_CHAIN (DECL_INITIAL (current_function_decl))
+ = block;
}
- else
- insert_block (block);
start_sequence ();
start = emit_note (NULL_PTR, NOTE_INSN_BLOCK_BEG);
+ if (current_function->x_whole_function_mode_p)
+ NOTE_BLOCK (start) = block;
fixup->before_jump = emit_note (NULL_PTR, NOTE_INSN_DELETED);
- emit_note (NULL_PTR, NOTE_INSN_BLOCK_END);
+ end = emit_note (NULL_PTR, NOTE_INSN_BLOCK_END);
+ if (current_function->x_whole_function_mode_p)
+ NOTE_BLOCK (end) = block;
fixup->context = block;
end_sequence ();
emit_insns_after (start, original_before_jump);
@@ -3198,20 +3205,36 @@ tail_recursion_args (actuals, formals)
will not create corresponding BLOCK nodes. (There should be
a one-to-one correspondence between NOTE_INSN_BLOCK_BEG notes
and BLOCKs.) If this flag is set, MARK_ENDS should be zero
- when expand_end_bindings is called. */
+ when expand_end_bindings is called.
+
+ If we are creating a NOTE_INSN_BLOCK_BEG note, a BLOCK may
+ optionally be supplied. If so, it becomes the NOTE_BLOCK for the
+ note. */
void
-expand_start_bindings (flags)
+expand_start_bindings_and_block (flags, block)
int flags;
+ tree block;
{
struct nesting *thisblock = ALLOC_NESTING ();
rtx note;
int exit_flag = ((flags & 1) != 0);
int block_flag = ((flags & 2) == 0);
+
+ /* If a BLOCK is supplied, then the caller should be requesting a
+ NOTE_INSN_BLOCK_BEG note. */
+ if (!block_flag && block)
+ abort ();
- note = emit_note (NULL_PTR,
- block_flag ? NOTE_INSN_BLOCK_BEG : NOTE_INSN_DELETED);
-
+ /* Create a note to mark the beginning of the block. */
+ if (block_flag)
+ {
+ note = emit_note (NULL_PTR, NOTE_INSN_BLOCK_BEG);
+ NOTE_BLOCK (note) = block;
+ }
+ else
+ note = emit_note (NULL_PTR, NOTE_INSN_DELETED);
+
/* Make an entry on block_stack for the block we are entering. */
thisblock->next = block_stack;
@@ -3659,7 +3682,10 @@ expand_end_bindings (vars, mark_ends, dont_jump_in)
just going out of scope, so they are in scope for their cleanups. */
if (mark_ends)
- emit_note (NULL_PTR, NOTE_INSN_BLOCK_END);
+ {
+ rtx note = emit_note (NULL_PTR, NOTE_INSN_BLOCK_END);
+ NOTE_BLOCK (note) = NOTE_BLOCK (thisblock->data.block.first_insn);
+ }
else
/* Get rid of the beginning-mark if we don't make an end-mark. */
NOTE_LINE_NUMBER (thisblock->data.block.first_insn) = NOTE_INSN_DELETED;