diff options
Diffstat (limited to 'gcc/cfghooks.h')
-rw-r--r-- | gcc/cfghooks.h | 57 |
1 files changed, 37 insertions, 20 deletions
diff --git a/gcc/cfghooks.h b/gcc/cfghooks.h index 5ef3b1f5480..4c2d0bf37bb 100644 --- a/gcc/cfghooks.h +++ b/gcc/cfghooks.h @@ -24,10 +24,12 @@ Boston, MA 02111-1307, USA. */ struct cfg_hooks { - /* Debugging. Do not use macros to hook these so they can be called from - debugger! */ - int (*cfgh_verify_flow_info) (void); - void (*dump_bb) (basic_block, FILE *); + /* Name of the corresponding ir. */ + const char *name; + + /* Debugging. */ + int (*verify_flow_info) (void); + void (*dump_bb) (basic_block, FILE *, int); /* Basic CFG manipulation. */ @@ -44,11 +46,15 @@ struct cfg_hooks on abnormal edge. */ basic_block (*redirect_edge_and_branch_force) (edge, basic_block); - /* Remove given basic block and all edges possibly pointing into it. */ - void (*delete_block) (basic_block); + /* Remove statements corresponding to a given basic block. */ + void (*delete_basic_block) (basic_block); + + /* Creates a new basic block just after basic block B by splitting + everything after specified instruction I. */ + basic_block (*split_block) (basic_block b, void * i); - /* Split basic block B after specified instruction I. */ - edge (*split_block) (basic_block b, void * i); + /* Move block B immediately after block A. */ + bool (*move_block_after) (basic_block b, basic_block a); /* Return true when blocks A and B can be merged into single basic block. */ bool (*can_merge_blocks_p) (basic_block a, basic_block b); @@ -58,23 +64,34 @@ struct cfg_hooks /* Higher level functions representable by primitive operations above if we didn't have some oddities in RTL and Tree representations. */ - basic_block (*cfgh_split_edge) (edge); + basic_block (*split_edge) (edge); + void (*make_forwarder_block) (edge); + + /* Tries to make the edge fallthru. */ + void (*tidy_fallthru_edge) (edge); }; -#define redirect_edge_and_branch(e,b) cfg_hooks->redirect_edge_and_branch (e,b) -#define redirect_edge_and_branch_force(e,b) cfg_hooks->redirect_edge_and_branch_force (e,b) -#define split_block(e,i) cfg_hooks->split_block (e,i) -#define delete_block(b) cfg_hooks->delete_block (b) -#define split_edge(e) cfg_hooks->cfgh_split_edge (e) -#define create_basic_block(h,e,a) cfg_hooks->create_basic_block (h,e,a) -#define can_merge_blocks_p(a,b) cfg_hooks->can_merge_blocks_p (a,b) -#define merge_blocks(a,b) cfg_hooks->merge_blocks (a,b) +extern void verify_flow_info (void); +extern void dump_bb (basic_block, FILE *, int); +extern bool redirect_edge_and_branch (edge, basic_block); +extern basic_block redirect_edge_and_branch_force (edge, basic_block); +extern edge split_block (basic_block, void *); +extern edge split_block_after_labels (basic_block); +extern bool move_block_after (basic_block, basic_block); +extern void delete_basic_block (basic_block); +extern basic_block split_edge (edge); +extern basic_block create_basic_block (void *, void *, basic_block); +extern basic_block create_empty_bb (basic_block); +extern bool can_merge_blocks_p (basic_block, basic_block); +extern void merge_blocks (basic_block, basic_block); +extern edge make_forwarder_block (basic_block, bool (*)(edge), + void (*) (basic_block)); +extern void tidy_fallthru_edge (edge); +extern void tidy_fallthru_edges (void); /* Hooks containers. */ extern struct cfg_hooks rtl_cfg_hooks; - -/* A pointer to one of the hooks containers. */ -extern struct cfg_hooks *cfg_hooks; +extern struct cfg_hooks cfg_layout_rtl_cfg_hooks; /* Declarations. */ extern void rtl_register_cfg_hooks (void); |