Commit bbd79259 by David Malcolm Committed by David Malcolm

Rename macros (basic_block_info_for_function, BASIC_BLOCK_FOR_FUNCTION,

SET_BASIC_BLOCK_FOR_FUNCTION)

gcc/
	* basic-block.h (basic_block_info_for_function): Rename to...
	(basic_block_info_for_fn): ...this.
	(BASIC_BLOCK_FOR_FUNCTION): Rename to...
	(BASIC_BLOCK_FOR_FN): ...this.
	(SET_BASIC_BLOCK_FOR_FUNCTION): Rename to...
	(SET_BASIC_BLOCK_FOR_FN): ...this.

	* gimple-streamer-in.c (input_phi, input_bb): Update for renaming
	of BASIC_BLOCK_FOR_FUNCTION to BASIC_BLOCK_FOR_FN.
	* ipa-utils.c (ipa_merge_profiles): Likewise.
	* lto-streamer-in.c (make_new_block): Update for renaming of
	SET_BASIC_BLOCK_FOR_FUNCTION to SET_BASIC_BLOCK_FOR_FN.
	(input_cfg): Update for renamings.
	* tree-cfg.c (init_empty_tree_cfg_for_function): Likewise.
	(dump_function_to_file): Update for renaming of
	basic_block_info_for_function to basic_block_info_for_fn.

From-SVN: r205816
parent 1f71a3c3
2013-12-09 David Malcolm <dmalcolm@redhat.com>
* basic-block.h (basic_block_info_for_function): Rename to...
(basic_block_info_for_fn): ...this.
(BASIC_BLOCK_FOR_FUNCTION): Rename to...
(BASIC_BLOCK_FOR_FN): ...this.
(SET_BASIC_BLOCK_FOR_FUNCTION): Rename to...
(SET_BASIC_BLOCK_FOR_FN): ...this.
* gimple-streamer-in.c (input_phi, input_bb): Update for renaming
of BASIC_BLOCK_FOR_FUNCTION to BASIC_BLOCK_FOR_FN.
* ipa-utils.c (ipa_merge_profiles): Likewise.
* lto-streamer-in.c (make_new_block): Update for renaming of
SET_BASIC_BLOCK_FOR_FUNCTION to SET_BASIC_BLOCK_FOR_FN.
(input_cfg): Update for renamings.
* tree-cfg.c (init_empty_tree_cfg_for_function): Likewise.
(dump_function_to_file): Update for renaming of
basic_block_info_for_function to basic_block_info_for_fn.
2013-12-09 Richard Biener <rguenther@suse.de> 2013-12-09 Richard Biener <rguenther@suse.de>
PR middle-end/38474 PR middle-end/38474
...@@ -314,17 +314,17 @@ struct GTY(()) control_flow_graph { ...@@ -314,17 +314,17 @@ struct GTY(()) control_flow_graph {
/* Defines for accessing the fields of the CFG structure for function FN. */ /* Defines for accessing the fields of the CFG structure for function FN. */
#define ENTRY_BLOCK_PTR_FOR_FN(FN) ((FN)->cfg->x_entry_block_ptr) #define ENTRY_BLOCK_PTR_FOR_FN(FN) ((FN)->cfg->x_entry_block_ptr)
#define EXIT_BLOCK_PTR_FOR_FN(FN) ((FN)->cfg->x_exit_block_ptr) #define EXIT_BLOCK_PTR_FOR_FN(FN) ((FN)->cfg->x_exit_block_ptr)
#define basic_block_info_for_function(FN) ((FN)->cfg->x_basic_block_info) #define basic_block_info_for_fn(FN) ((FN)->cfg->x_basic_block_info)
#define n_basic_blocks_for_fn(FN) ((FN)->cfg->x_n_basic_blocks) #define n_basic_blocks_for_fn(FN) ((FN)->cfg->x_n_basic_blocks)
#define n_edges_for_fn(FN) ((FN)->cfg->x_n_edges) #define n_edges_for_fn(FN) ((FN)->cfg->x_n_edges)
#define last_basic_block_for_function(FN) ((FN)->cfg->x_last_basic_block) #define last_basic_block_for_function(FN) ((FN)->cfg->x_last_basic_block)
#define label_to_block_map_for_function(FN) ((FN)->cfg->x_label_to_block_map) #define label_to_block_map_for_function(FN) ((FN)->cfg->x_label_to_block_map)
#define profile_status_for_function(FN) ((FN)->cfg->x_profile_status) #define profile_status_for_function(FN) ((FN)->cfg->x_profile_status)
#define BASIC_BLOCK_FOR_FUNCTION(FN,N) \ #define BASIC_BLOCK_FOR_FN(FN,N) \
((*basic_block_info_for_function (FN))[(N)]) ((*basic_block_info_for_fn (FN))[(N)])
#define SET_BASIC_BLOCK_FOR_FUNCTION(FN,N,BB) \ #define SET_BASIC_BLOCK_FOR_FN(FN,N,BB) \
((*basic_block_info_for_function (FN))[(N)] = (BB)) ((*basic_block_info_for_fn (FN))[(N)] = (BB))
/* Defines for textual backward source compatibility. */ /* Defines for textual backward source compatibility. */
#define basic_block_info (cfun->cfg->x_basic_block_info) #define basic_block_info (cfun->cfg->x_basic_block_info)
......
...@@ -67,7 +67,7 @@ input_phi (struct lto_input_block *ib, basic_block bb, struct data_in *data_in, ...@@ -67,7 +67,7 @@ input_phi (struct lto_input_block *ib, basic_block bb, struct data_in *data_in,
int src_index = streamer_read_uhwi (ib); int src_index = streamer_read_uhwi (ib);
bitpack_d bp = streamer_read_bitpack (ib); bitpack_d bp = streamer_read_bitpack (ib);
location_t arg_loc = stream_input_location (&bp, data_in); location_t arg_loc = stream_input_location (&bp, data_in);
basic_block sbb = BASIC_BLOCK_FOR_FUNCTION (fn, src_index); basic_block sbb = BASIC_BLOCK_FOR_FN (fn, src_index);
edge e = NULL; edge e = NULL;
int j; int j;
...@@ -258,7 +258,7 @@ input_bb (struct lto_input_block *ib, enum LTO_tags tag, ...@@ -258,7 +258,7 @@ input_bb (struct lto_input_block *ib, enum LTO_tags tag,
gcc_assert (cfun == fn); gcc_assert (cfun == fn);
index = streamer_read_uhwi (ib); index = streamer_read_uhwi (ib);
bb = BASIC_BLOCK_FOR_FUNCTION (fn, index); bb = BASIC_BLOCK_FOR_FN (fn, index);
bb->count = apply_scale (streamer_read_gcov_count (ib), bb->count = apply_scale (streamer_read_gcov_count (ib),
count_materialization_scale); count_materialization_scale);
......
...@@ -727,7 +727,7 @@ ipa_merge_profiles (struct cgraph_node *dst, ...@@ -727,7 +727,7 @@ ipa_merge_profiles (struct cgraph_node *dst,
{ {
unsigned int i; unsigned int i;
dstbb = BASIC_BLOCK_FOR_FUNCTION (dstcfun, srcbb->index); dstbb = BASIC_BLOCK_FOR_FN (dstcfun, srcbb->index);
if (dstbb == NULL) if (dstbb == NULL)
{ {
if (cgraph_dump_file) if (cgraph_dump_file)
...@@ -772,7 +772,7 @@ ipa_merge_profiles (struct cgraph_node *dst, ...@@ -772,7 +772,7 @@ ipa_merge_profiles (struct cgraph_node *dst,
{ {
unsigned int i; unsigned int i;
dstbb = BASIC_BLOCK_FOR_FUNCTION (dstcfun, srcbb->index); dstbb = BASIC_BLOCK_FOR_FN (dstcfun, srcbb->index);
dstbb->count += srcbb->count; dstbb->count += srcbb->count;
for (i = 0; i < EDGE_COUNT (srcbb->succs); i++) for (i = 0; i < EDGE_COUNT (srcbb->succs); i++)
{ {
......
...@@ -611,7 +611,7 @@ make_new_block (struct function *fn, unsigned int index) ...@@ -611,7 +611,7 @@ make_new_block (struct function *fn, unsigned int index)
{ {
basic_block bb = alloc_block (); basic_block bb = alloc_block ();
bb->index = index; bb->index = index;
SET_BASIC_BLOCK_FOR_FUNCTION (fn, index, bb); SET_BASIC_BLOCK_FOR_FN (fn, index, bb);
n_basic_blocks_for_fn (fn)++; n_basic_blocks_for_fn (fn)++;
return bb; return bb;
} }
...@@ -638,8 +638,8 @@ input_cfg (struct lto_input_block *ib, struct data_in *data_in, ...@@ -638,8 +638,8 @@ input_cfg (struct lto_input_block *ib, struct data_in *data_in,
bb_count = streamer_read_uhwi (ib); bb_count = streamer_read_uhwi (ib);
last_basic_block_for_function (fn) = bb_count; last_basic_block_for_function (fn) = bb_count;
if (bb_count > basic_block_info_for_function (fn)->length ()) if (bb_count > basic_block_info_for_fn (fn)->length ())
vec_safe_grow_cleared (basic_block_info_for_function (fn), bb_count); vec_safe_grow_cleared (basic_block_info_for_fn (fn), bb_count);
if (bb_count > label_to_block_map_for_function (fn)->length ()) if (bb_count > label_to_block_map_for_function (fn)->length ())
vec_safe_grow_cleared (label_to_block_map_for_function (fn), bb_count); vec_safe_grow_cleared (label_to_block_map_for_function (fn), bb_count);
...@@ -647,7 +647,7 @@ input_cfg (struct lto_input_block *ib, struct data_in *data_in, ...@@ -647,7 +647,7 @@ input_cfg (struct lto_input_block *ib, struct data_in *data_in,
index = streamer_read_hwi (ib); index = streamer_read_hwi (ib);
while (index != -1) while (index != -1)
{ {
basic_block bb = BASIC_BLOCK_FOR_FUNCTION (fn, index); basic_block bb = BASIC_BLOCK_FOR_FN (fn, index);
unsigned int edge_count; unsigned int edge_count;
if (bb == NULL) if (bb == NULL)
...@@ -671,7 +671,7 @@ input_cfg (struct lto_input_block *ib, struct data_in *data_in, ...@@ -671,7 +671,7 @@ input_cfg (struct lto_input_block *ib, struct data_in *data_in,
count_materialization_scale); count_materialization_scale);
edge_flags = streamer_read_uhwi (ib); edge_flags = streamer_read_uhwi (ib);
dest = BASIC_BLOCK_FOR_FUNCTION (fn, dest_index); dest = BASIC_BLOCK_FOR_FN (fn, dest_index);
if (dest == NULL) if (dest == NULL)
dest = make_new_block (fn, dest_index); dest = make_new_block (fn, dest_index);
...@@ -688,7 +688,7 @@ input_cfg (struct lto_input_block *ib, struct data_in *data_in, ...@@ -688,7 +688,7 @@ input_cfg (struct lto_input_block *ib, struct data_in *data_in,
index = streamer_read_hwi (ib); index = streamer_read_hwi (ib);
while (index != -1) while (index != -1)
{ {
basic_block bb = BASIC_BLOCK_FOR_FUNCTION (fn, index); basic_block bb = BASIC_BLOCK_FOR_FN (fn, index);
bb->prev_bb = p_bb; bb->prev_bb = p_bb;
p_bb->next_bb = bb; p_bb->next_bb = bb;
p_bb = bb; p_bb = bb;
...@@ -719,7 +719,7 @@ input_cfg (struct lto_input_block *ib, struct data_in *data_in, ...@@ -719,7 +719,7 @@ input_cfg (struct lto_input_block *ib, struct data_in *data_in,
} }
struct loop *loop = alloc_loop (); struct loop *loop = alloc_loop ();
loop->header = BASIC_BLOCK_FOR_FUNCTION (fn, header_index); loop->header = BASIC_BLOCK_FOR_FN (fn, header_index);
loop->header->loop_father = loop; loop->header->loop_father = loop;
/* Read everything copy_loop_info copies. */ /* Read everything copy_loop_info copies. */
......
...@@ -185,8 +185,8 @@ init_empty_tree_cfg_for_function (struct function *fn) ...@@ -185,8 +185,8 @@ init_empty_tree_cfg_for_function (struct function *fn)
profile_status_for_function (fn) = PROFILE_ABSENT; profile_status_for_function (fn) = PROFILE_ABSENT;
n_basic_blocks_for_fn (fn) = NUM_FIXED_BLOCKS; n_basic_blocks_for_fn (fn) = NUM_FIXED_BLOCKS;
last_basic_block_for_function (fn) = NUM_FIXED_BLOCKS; last_basic_block_for_function (fn) = NUM_FIXED_BLOCKS;
vec_alloc (basic_block_info_for_function (fn), initial_cfg_capacity); vec_alloc (basic_block_info_for_fn (fn), initial_cfg_capacity);
vec_safe_grow_cleared (basic_block_info_for_function (fn), vec_safe_grow_cleared (basic_block_info_for_fn (fn),
initial_cfg_capacity); initial_cfg_capacity);
/* Build a mapping of labels to their associated blocks. */ /* Build a mapping of labels to their associated blocks. */
...@@ -194,10 +194,8 @@ init_empty_tree_cfg_for_function (struct function *fn) ...@@ -194,10 +194,8 @@ init_empty_tree_cfg_for_function (struct function *fn)
vec_safe_grow_cleared (label_to_block_map_for_function (fn), vec_safe_grow_cleared (label_to_block_map_for_function (fn),
initial_cfg_capacity); initial_cfg_capacity);
SET_BASIC_BLOCK_FOR_FUNCTION (fn, ENTRY_BLOCK, SET_BASIC_BLOCK_FOR_FN (fn, ENTRY_BLOCK, ENTRY_BLOCK_PTR_FOR_FN (fn));
ENTRY_BLOCK_PTR_FOR_FN (fn)); SET_BASIC_BLOCK_FOR_FN (fn, EXIT_BLOCK, EXIT_BLOCK_PTR_FOR_FN (fn));
SET_BASIC_BLOCK_FOR_FUNCTION (fn, EXIT_BLOCK,
EXIT_BLOCK_PTR_FOR_FN (fn));
ENTRY_BLOCK_PTR_FOR_FN (fn)->next_bb ENTRY_BLOCK_PTR_FOR_FN (fn)->next_bb
= EXIT_BLOCK_PTR_FOR_FN (fn); = EXIT_BLOCK_PTR_FOR_FN (fn);
...@@ -7046,7 +7044,7 @@ dump_function_to_file (tree fndecl, FILE *file, int flags) ...@@ -7046,7 +7044,7 @@ dump_function_to_file (tree fndecl, FILE *file, int flags)
if (fun && fun->decl == fndecl if (fun && fun->decl == fndecl
&& fun->cfg && fun->cfg
&& basic_block_info_for_function (fun)) && basic_block_info_for_fn (fun))
{ {
/* If the CFG has been built, emit a CFG-based dump. */ /* If the CFG has been built, emit a CFG-based dump. */
if (!ignore_topmost_bind) if (!ignore_topmost_bind)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment