diff options
author | Lawrence Crowl <crowl@google.com> | 2012-11-01 21:02:15 +0000 |
---|---|---|
committer | Lawrence Crowl <crowl@gcc.gnu.org> | 2012-11-01 21:02:15 +0000 |
commit | d4ac4ce2d38ef15977539ab5cd33876470011c3c (patch) | |
tree | 6a2b07bcbe69d6025168367c7ef581e376cca84c /gcc/ddg.c | |
parent | 0dd4969120693e1040ff3cd2076571618baa616d (diff) | |
download | gcc-d4ac4ce2d38ef15977539ab5cd33876470011c3c.zip gcc-d4ac4ce2d38ef15977539ab5cd33876470011c3c.tar.gz gcc-d4ac4ce2d38ef15977539ab5cd33876470011c3c.tar.bz2 |
This patch renames sbitmap iterators to unify them with the bitmap iterators.
Remove the unused EXECUTE_IF_SET_IN_SBITMAP_REV, which has an unconventional
interface.
Rename the sbitmap_iter_* functions to match bitmap's bmp_iter_* functions.
Add an additional parameter to the initialization and next functions to
match the interface in bmp_iter_*. This extra parameter is mostly hidden
by the use of the EXECUTE_IF macros.
Rename the EXECUTE_IF_SET_IN_SBITMAP macro to EXECUTE_IF_SET_IN_BITMAP. Its
implementation is now identical to that in bitmap.h. To prevent redefinition
errors, both definitions are now guarded by #ifndef. An alternate strategy
is to simply include bitmap.h from sbitmap.h. As this would increase build
time, I have elected to use the #ifndef version. I do not have a strong
preference here.
The sbitmap_iterator type is still distinctly named because it is often
declared in contexts where the bitmap type is not obvious. There are less
than 40 uses of this type, so the burden to modify it when changing bitmap
types is not large.
Tested on x86-64, config-list.mk testing.
Index: gcc/ChangeLog
2012-10-31 Lawrence Crowl <crowl@google.com>
* sbitmap.h (sbitmap_iter_init): Rename bmp_iter_set_init and add
unused parameter to match bitmap iterator. Update callers.
(sbitmap_iter_cond): Rename bmp_iter_set. Update callers.
(sbitmap_iter_next): Rename bmp_iter_next and add unused parameter to
match bitmap iterator. Update callers.
(EXECUTE_IF_SET_IN_SBITMAP_REV): Remove unused.
(EXECUTE_IF_SET_IN_SBITMAP): Rename EXECUTE_IF_SET_IN_BITMAP and
adjust to be identical to the definition in bitmap.h. Conditionalize
the definition based on not having been defined. Update callers.
* bitmap.h (EXECUTE_IF_SET_IN_BITMAP): Conditionalize the definition
based on not having been defined. (To match the above.)
From-SVN: r193069
Diffstat (limited to 'gcc/ddg.c')
-rw-r--r-- | gcc/ddg.c | 14 |
1 files changed, 7 insertions, 7 deletions
@@ -801,7 +801,7 @@ print_sccs (FILE *file, ddg_all_sccs_ptr sccs, ddg_ptr g) for (i = 0; i < sccs->num_sccs; i++) { fprintf (file, "SCC number: %d\n", i); - EXECUTE_IF_SET_IN_SBITMAP (sccs->sccs[i]->nodes, 0, u, sbi) + EXECUTE_IF_SET_IN_BITMAP (sccs->sccs[i]->nodes, 0, u, sbi) { fprintf (file, "insn num %d\n", u); print_rtl_single (file, g->nodes[u].insn); @@ -893,7 +893,7 @@ create_scc (ddg_ptr g, sbitmap nodes) bitmap_copy (scc->nodes, nodes); /* Mark the backarcs that belong to this SCC. */ - EXECUTE_IF_SET_IN_SBITMAP (nodes, 0, u, sbi) + EXECUTE_IF_SET_IN_BITMAP (nodes, 0, u, sbi) { ddg_edge_ptr e; ddg_node_ptr n = &g->nodes[u]; @@ -977,7 +977,7 @@ find_successors (sbitmap succ, ddg_ptr g, sbitmap ops) unsigned int i = 0; sbitmap_iterator sbi; - EXECUTE_IF_SET_IN_SBITMAP (ops, 0, i, sbi) + EXECUTE_IF_SET_IN_BITMAP (ops, 0, i, sbi) { const sbitmap node_succ = NODE_SUCCESSORS (&g->nodes[i]); bitmap_ior (succ, succ, node_succ); @@ -996,7 +996,7 @@ find_predecessors (sbitmap preds, ddg_ptr g, sbitmap ops) unsigned int i = 0; sbitmap_iterator sbi; - EXECUTE_IF_SET_IN_SBITMAP (ops, 0, i, sbi) + EXECUTE_IF_SET_IN_BITMAP (ops, 0, i, sbi) { const sbitmap node_preds = NODE_PREDECESSORS (&g->nodes[i]); bitmap_ior (preds, preds, node_preds); @@ -1141,7 +1141,7 @@ find_nodes_on_paths (sbitmap result, ddg_ptr g, sbitmap from, sbitmap to) change = 0; bitmap_copy (workset, tmp); bitmap_clear (tmp); - EXECUTE_IF_SET_IN_SBITMAP (workset, 0, u, sbi) + EXECUTE_IF_SET_IN_BITMAP (workset, 0, u, sbi) { ddg_edge_ptr e; ddg_node_ptr u_node = &g->nodes[u]; @@ -1170,7 +1170,7 @@ find_nodes_on_paths (sbitmap result, ddg_ptr g, sbitmap from, sbitmap to) change = 0; bitmap_copy (workset, tmp); bitmap_clear (tmp); - EXECUTE_IF_SET_IN_SBITMAP (workset, 0, u, sbi) + EXECUTE_IF_SET_IN_BITMAP (workset, 0, u, sbi) { ddg_edge_ptr e; ddg_node_ptr u_node = &g->nodes[u]; @@ -1257,7 +1257,7 @@ longest_simple_path (struct ddg * g, int src, int dest, sbitmap nodes) change = 0; bitmap_copy (workset, tmp); bitmap_clear (tmp); - EXECUTE_IF_SET_IN_SBITMAP (workset, 0, u, sbi) + EXECUTE_IF_SET_IN_BITMAP (workset, 0, u, sbi) { ddg_node_ptr u_node = &g->nodes[u]; |