function.h (insert_block_after_note): Declare.

* function.h (insert_block_after_note): Declare.
	* function.c (insert_block_after_note): Split out from ...
	(retrofit_block): ... here.

From-SVN: r30776
This commit is contained in:
Mark Mitchell 1999-12-05 00:13:53 +00:00 committed by Mark Mitchell
parent 12f6122895
commit 4ce8936485
3 changed files with 46 additions and 20 deletions

View File

@ -1,5 +1,9 @@
1999-12-04 Mark Mitchell <mark@codesourcery.com>
* function.h (insert_block_after_note): Declare.
* function.c (insert_block_after_note): Split out from ...
(retrofit_block): ... here.
* stmt.c (expand_fixup): Fix typo in comment.
Sat Dec 4 14:13:38 MET 1999 Jan Hubicka <hubicka@freesoft.cz>

View File

@ -5482,6 +5482,37 @@ round_trampoline_addr (tramp)
return tramp;
}
/* Insert the BLOCK in the block-tree, knowing that the previous
block-note is for OLD_BLOCK. BEGIN_P is non-zero if the previous
block-note was the for the beginning of a BLOCK. FN is the
FUNCTION_DECL into which the BLOCK is being inserted. */
void
insert_block_after_note (block, old_block, begin_p, fn)
tree block;
tree old_block;
int begin_p;
tree fn;
{
if (begin_p)
{
/* If there was no previous block, use the top-level block for
the function. */
if (!old_block)
old_block = DECL_INITIAL (fn);
BLOCK_SUPERCONTEXT (block) = old_block;
BLOCK_CHAIN (block) = BLOCK_SUBBLOCKS (old_block);
BLOCK_SUBBLOCKS (old_block) = block;
}
else
{
BLOCK_SUPERCONTEXT (block) = BLOCK_SUPERCONTEXT (old_block);
BLOCK_CHAIN (block) = BLOCK_CHAIN (old_block);
BLOCK_CHAIN (old_block) = block;
}
}
/* Insert the BLOCK in the block-tree before LAST_INSN. */
void
@ -5502,27 +5533,13 @@ retrofit_block (block, last_insn)
&& (NOTE_LINE_NUMBER (insn) == NOTE_INSN_BLOCK_BEG
|| NOTE_LINE_NUMBER (insn) == NOTE_INSN_BLOCK_END))
break;
if (!insn || NOTE_LINE_NUMBER (insn) == NOTE_INSN_BLOCK_BEG)
{
tree superblock;
if (insn)
superblock = NOTE_BLOCK (insn);
else
superblock = DECL_INITIAL (current_function_decl);
BLOCK_SUPERCONTEXT (block) = superblock;
BLOCK_CHAIN (block) = BLOCK_SUBBLOCKS (superblock);
BLOCK_SUBBLOCKS (superblock) = block;
}
else
{
tree prevblock = NOTE_BLOCK (insn);
BLOCK_SUPERCONTEXT (block) = BLOCK_SUPERCONTEXT (prevblock);
BLOCK_CHAIN (block) = BLOCK_CHAIN (prevblock);
BLOCK_CHAIN (prevblock) = block;
}
insert_block_after_note (block,
insn ? NOTE_BLOCK (insn) : NULL_TREE,
insn
? (NOTE_LINE_NUMBER (insn) == NOTE_INSN_BLOCK_BEG)
: 1,
current_function_decl);
}
/* The functions identify_blocks and reorder_blocks provide a way to

View File

@ -541,6 +541,11 @@ extern struct function *outer_function_chain;
Also store in each NOTE for the beginning or end of a block
the index of that block in the vector. */
extern void identify_blocks PROTO((tree, rtx));
/* Insert the BLOCK in the block-tree, knowing that the previous
block-note is for OLD_BLOCK. BEGIN_P is non-zero if the previous
block-note was the for the beginning of a BLOCK. FN is the
FUNCTION_DECL into which the BLOCK is being inserted. */
extern void insert_block_after_note PROTO((tree, tree, int, tree));
/* Insert a new BLOCK at an appropriate place in the block tree. */
extern void retrofit_block PROTO((tree, rtx));