diff options
author | rakdver <rakdver@138bc75d-0d04-0410-961f-82ee72b054a4> | 2002-05-19 22:25:49 +0000 |
---|---|---|
committer | rakdver <rakdver@138bc75d-0d04-0410-961f-82ee72b054a4> | 2002-05-19 22:25:49 +0000 |
commit | 7fa55aef8e8e951f40edb73837f7a2ca2cd126d0 (patch) | |
tree | da3145061eccb50182bb789146df5bbe4f748226 /gcc/cfg.c | |
parent | 08eedad60368d251f0544a6376b0f999d0f8a54a (diff) | |
download | gcc-7fa55aef8e8e951f40edb73837f7a2ca2cd126d0.tar.gz |
* basic_block.h (struct basic_block_def): Added prev_bb and next_bb
fields.
(FOR_BB_BETWEEN, FOR_ALL_BB, FOR_ALL_BB_REVERSE): New macros for
traversing basic block chain.
(create_basic_block_structure, create_basic_block): Declaration changed.
(link_block, unlink_block): Declare.
* cfg.c (entry_exit_blocks): Initialize new fields.
(link_block, unlink_block): New.
(expunge_block_nocompact): Unlink basic block.
(dump_flow_info): Print prev_bb/next_bb fields.
* cfgbuild.c (find_basic_blocks_1, find_basic_blocks): Modified.
* cfgcleanup.c (merge_blocks_move_predecessor_nojumps): Modified.
* cfglayout.c (fixup_reorder_chain, cfg_layout_duplicate_bb): Modified.
* cfgrtl.c (create_basic_block_structure, create_basic_block,
split_block, force_nonfallthru_and_redirect, split_edge): Modified.
(verify_flow_info): Check that list agrees with numbering.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@53642 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/cfg.c')
-rw-r--r-- | gcc/cfg.c | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/gcc/cfg.c b/gcc/cfg.c index 47dfb238ea5..d1045331e2b 100644 --- a/gcc/cfg.c +++ b/gcc/cfg.c @@ -93,6 +93,8 @@ struct basic_block_def entry_exit_blocks[2] NULL, /* global_live_at_end */ NULL, /* aux */ ENTRY_BLOCK, /* index */ + NULL, /* prev_bb */ + EXIT_BLOCK_PTR, /* next_bb */ 0, /* loop_depth */ 0, /* count */ 0, /* frequency */ @@ -111,6 +113,8 @@ struct basic_block_def entry_exit_blocks[2] NULL, /* global_live_at_end */ NULL, /* aux */ EXIT_BLOCK, /* index */ + ENTRY_BLOCK_PTR, /* prev_bb */ + NULL, /* next_bb */ 0, /* loop_depth */ 0, /* count */ 0, /* frequency */ @@ -220,12 +224,35 @@ alloc_block () return bb; } +/* Link block B to chain after AFTER. */ +void +link_block (b, after) + basic_block b, after; +{ + b->next_bb = after->next_bb; + b->prev_bb = after; + after->next_bb = b; + b->next_bb->prev_bb = b; +} + +/* Unlink block B from chain. */ +void +unlink_block (b) + basic_block b; +{ + b->next_bb->prev_bb = b->prev_bb; + b->prev_bb->next_bb = b->next_bb; +} + + /* Remove block B from the basic block array and compact behind it. */ void expunge_block_nocompact (b) basic_block b; { + unlink_block (b); + /* Invalidate data to make bughunting easier. */ memset (b, 0, sizeof *b); b->index = -3; @@ -521,6 +548,8 @@ dump_flow_info (file) fprintf (file, "\nBasic block %d: first insn %d, last %d, ", i, INSN_UID (bb->head), INSN_UID (bb->end)); + fprintf (file, "prev %d, next %d, ", + bb->prev_bb->index, bb->next_bb->index); fprintf (file, "loop_depth %d, count ", bb->loop_depth); fprintf (file, HOST_WIDEST_INT_PRINT_DEC, bb->count); fprintf (file, ", freq %i.\n", bb->frequency); |