diff options
author | Jan Hubicka <jh@suse.cz> | 2005-05-13 00:32:16 +0200 |
---|---|---|
committer | Jan Hubicka <hubicka@gcc.gnu.org> | 2005-05-12 22:32:16 +0000 |
commit | a930a4efe71a7e8d3fa0279efb3952f482f61927 (patch) | |
tree | 316bfa9275d9c94833734dca42a7387ce4a3d203 /gcc/tree-cfg.c | |
parent | 0995a441f572b99071e2ab2b256c027e4a19e217 (diff) | |
download | gcc-a930a4efe71a7e8d3fa0279efb3952f482f61927.zip gcc-a930a4efe71a7e8d3fa0279efb3952f482f61927.tar.gz gcc-a930a4efe71a7e8d3fa0279efb3952f482f61927.tar.bz2 |
basic-block.h (FOR_ALL_BB_FN): New macro.
* basic-block.h (FOR_ALL_BB_FN): New macro.
(init_flow): Initialize cfg structure.
* function.c (allocate_struct_function): Do not initialize cfg structure.
* tree-cfg.c (init_empty_tree_cfg): Break out from ...
(build_tree_cfg): ... here.
* tree-flow.h (init_empty_tree_cfg): Declare.
From-SVN: r99633
Diffstat (limited to 'gcc/tree-cfg.c')
-rw-r--r-- | gcc/tree-cfg.c | 36 |
1 files changed, 21 insertions, 15 deletions
diff --git a/gcc/tree-cfg.c b/gcc/tree-cfg.c index 9860a29..9f0d1e5 100644 --- a/gcc/tree-cfg.c +++ b/gcc/tree-cfg.c @@ -132,6 +132,26 @@ static tree find_case_label_for_value (tree, tree); static bool phi_alternatives_equal (basic_block, edge, edge); static bool cleanup_forwarder_blocks (void); +void +init_empty_tree_cfg (void) +{ + /* Initialize the basic block array. */ + init_flow (); + profile_status = PROFILE_ABSENT; + n_basic_blocks = 0; + last_basic_block = 0; + VARRAY_BB_INIT (basic_block_info, initial_cfg_capacity, "basic_block_info"); + + /* Build a mapping of labels to their associated blocks. */ + VARRAY_BB_INIT (label_to_block_map, initial_cfg_capacity, + "label to block map"); + + ENTRY_BLOCK_PTR->next_bb = EXIT_BLOCK_PTR; + EXIT_BLOCK_PTR->prev_bb = ENTRY_BLOCK_PTR; + + create_block_annotation (ENTRY_BLOCK_PTR); + create_block_annotation (EXIT_BLOCK_PTR); +} /*--------------------------------------------------------------------------- Create basic blocks @@ -146,20 +166,9 @@ build_tree_cfg (tree *tp) /* Register specific tree functions. */ tree_register_cfg_hooks (); - /* Initialize the basic block array. */ - init_flow (); - profile_status = PROFILE_ABSENT; - n_basic_blocks = 0; - last_basic_block = 0; - VARRAY_BB_INIT (basic_block_info, initial_cfg_capacity, "basic_block_info"); memset ((void *) &cfg_stats, 0, sizeof (cfg_stats)); - /* Build a mapping of labels to their associated blocks. */ - VARRAY_BB_INIT (label_to_block_map, initial_cfg_capacity, - "label to block map"); - - ENTRY_BLOCK_PTR->next_bb = EXIT_BLOCK_PTR; - EXIT_BLOCK_PTR->prev_bb = ENTRY_BLOCK_PTR; + init_empty_tree_cfg (); found_computed_goto = 0; make_blocks (*tp); @@ -176,9 +185,6 @@ build_tree_cfg (tree *tp) if (n_basic_blocks == 0) create_empty_bb (ENTRY_BLOCK_PTR); - create_block_annotation (ENTRY_BLOCK_PTR); - create_block_annotation (EXIT_BLOCK_PTR); - /* Adjust the size of the array. */ VARRAY_GROW (basic_block_info, n_basic_blocks); |