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/basic-block.h | |
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/basic-block.h')
-rw-r--r-- | gcc/basic-block.h | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/gcc/basic-block.h b/gcc/basic-block.h index 5615b145f02..cf0d13ad2d5 100644 --- a/gcc/basic-block.h +++ b/gcc/basic-block.h @@ -206,6 +206,9 @@ typedef struct basic_block_def { /* The index of this block. */ int index; + /* Previous and next blocks in the chain. */ + struct basic_block_def *prev_bb, *next_bb; + /* The loop depth of this block. */ int loop_depth; @@ -240,6 +243,16 @@ extern varray_type basic_block_info; #define BASIC_BLOCK(N) (VARRAY_BB (basic_block_info, (N))) +/* For iterating over basic blocks. */ +#define FOR_BB_BETWEEN(BB, FROM, TO, DIR) \ + for (BB = FROM; BB != TO; BB = BB->DIR) + +#define FOR_EACH_BB(BB) \ + FOR_BB_BETWEEN (BB, ENTRY_BLOCK_PTR->next_bb, EXIT_BLOCK_PTR, next_bb) + +#define FOR_EACH_BB_REVERSE(BB) \ + FOR_BB_BETWEEN (BB, EXIT_BLOCK_PTR->prev_bb, ENTRY_BLOCK_PTR, prev_bb) + /* What registers are live at the setjmp call. */ extern regset regs_live_at_setjmp; @@ -314,8 +327,8 @@ extern void remove_edge PARAMS ((edge)); extern void redirect_edge_succ PARAMS ((edge, basic_block)); extern edge redirect_edge_succ_nodup PARAMS ((edge, basic_block)); extern void redirect_edge_pred PARAMS ((edge, basic_block)); -extern basic_block create_basic_block_structure PARAMS ((int, rtx, rtx, rtx)); -extern basic_block create_basic_block PARAMS ((int, rtx, rtx)); +extern basic_block create_basic_block_structure PARAMS ((int, rtx, rtx, rtx, basic_block)); +extern basic_block create_basic_block PARAMS ((rtx, rtx, basic_block)); extern int flow_delete_block PARAMS ((basic_block)); extern int flow_delete_block_noexpunge PARAMS ((basic_block)); extern void clear_bb_flags PARAMS ((void)); @@ -644,6 +657,8 @@ extern void debug_regset PARAMS ((regset)); extern void allocate_reg_life_data PARAMS ((void)); extern void allocate_bb_life_data PARAMS ((void)); extern void expunge_block PARAMS ((basic_block)); +extern void link_block PARAMS ((basic_block, basic_block)); +extern void unlink_block PARAMS ((basic_block)); extern void expunge_block_nocompact PARAMS ((basic_block)); extern basic_block alloc_block PARAMS ((void)); extern void find_unreachable_blocks PARAMS ((void)); |