remove irbitset.h
authorMatthias Braun <matze@braunis.de>
Fri, 11 Nov 2011 12:13:05 +0000 (13:13 +0100)
committerMatthias Braun <matze@braunis.de>
Mon, 14 Nov 2011 10:15:15 +0000 (11:15 +0100)
ir/Makefile.am
ir/be/beabi.c
ir/be/bechordal.c
ir/be/bechordal_main.c
ir/be/becopyheur4.c
ir/be/becopyopt.c
ir/be/beifg.c
ir/be/belive.c
ir/be/ia32/bearch_ia32.c
ir/be/ia32/ia32_optimize.c
ir/ir/irbitset.h [deleted file]

index f7079bf..74b39c3 100644 (file)
@@ -321,7 +321,6 @@ EXTRA_DIST = \
        ident/ident_t.h \
        ir/instrument.h \
        ir/irargs_t.h \
-       ir/irbitset.h \
        ir/ircons_t.h \
        ir/irdump_t.h \
        ir/iredges_t.h \
index 31331df..9683b4c 100644 (file)
@@ -36,7 +36,6 @@
 #include "irgwalk.h"
 #include "irprintf_t.h"
 #include "irgopt.h"
-#include "irbitset.h"
 #include "iropt_t.h"
 #include "irtools.h"
 #include "heights.h"
index ce8ccbd..ae5f29e 100644 (file)
@@ -43,7 +43,6 @@
 #include "irdump.h"
 #include "irdom.h"
 #include "irtools.h"
-#include "irbitset.h"
 #include "debug.h"
 #include "iredges.h"
 
index 8cad1f9..6bf0e7b 100644 (file)
@@ -46,7 +46,6 @@
 #include "irdump.h"
 #include "irdom.h"
 #include "ircons.h"
-#include "irbitset.h"
 #include "irnode.h"
 #include "ircons.h"
 #include "irtools.h"
index 5377e22..3199538 100644 (file)
 #include "xmalloc.h"
 #include "pdeq.h"
 #include "irprintf.h"
-#include "irbitset.h"
 #include "util.h"
 #include "irtools.h"
 #include "error.h"
 #include "list.h"
 #include "statev.h"
 
-#include "irbitset.h"
-
 #include "bearch.h"
 #include "beifg.h"
 #include "be_t.h"
@@ -772,13 +769,13 @@ static __attribute__((unused)) void chunk_order_nodes(co_mst_env_t *env, aff_chu
        }
 
        if (max_node) {
-               bitset_t *visited = bitset_irg_malloc(env->co->irg);
+               bitset_t *visited = bitset_malloc(get_irg_last_idx(env->co->irg));
 
                for (i = ARR_LEN(chunk->n); i != 0;)
-                       bitset_add_irn(visited, chunk->n[--i]);
+                       bitset_set(visited, get_irn_idx(chunk->n[--i]));
 
                pqueue_put(grow, (void *) max_node, max_weight);
-               bitset_remv_irn(visited, max_node);
+               bitset_clear(visited, get_irn_idx(max_node));
                i = 0;
                while (!pqueue_empty(grow)) {
                        ir_node *irn = (ir_node*)pqueue_pop_front(grow);
@@ -797,9 +794,9 @@ static __attribute__((unused)) void chunk_order_nodes(co_mst_env_t *env, aff_chu
                        co_gs_foreach_neighb(an, neigh) {
                                co_mst_irn_t *node = get_co_mst_irn(env, neigh->irn);
 
-                               if (bitset_contains_irn(visited, node->irn)) {
+                               if (bitset_is_set(visited, get_irn_idx(node->irn))) {
                                        pqueue_put(grow, (void *) neigh->irn, neigh->costs);
-                                       bitset_remv_irn(visited, node->irn);
+                                       bitset_clear(visited, get_irn_idx(node->irn));
                                }
                        }
                }
@@ -877,7 +874,7 @@ static void expand_chunk_from(co_mst_env_t *env, co_mst_irn_t *node, bitset_t *v
  */
 static aff_chunk_t *fragment_chunk(co_mst_env_t *env, int col, aff_chunk_t *c, waitq *tmp)
 {
-       bitset_t    *visited = bitset_irg_malloc(env->co->irg);
+       bitset_t    *visited = bitset_malloc(get_irg_last_idx(env->co->irg));
        int         idx, len;
        aff_chunk_t *best = NULL;
 
@@ -1397,7 +1394,7 @@ static void color_aff_chunk(co_mst_env_t *env, aff_chunk_t *c)
        }
 
        /* fragment the remaining chunk */
-       visited = bitset_irg_malloc(env->co->irg);
+       visited = bitset_malloc(get_irg_last_idx(env->co->irg));
        for (idx = 0, len = ARR_LEN(best_chunk->n); idx < len; ++idx)
                bitset_set(visited, get_irn_idx(best_chunk->n[idx]));
 
index 786e370..04516a4 100644 (file)
@@ -41,7 +41,6 @@
 #include "irprog.h"
 #include "irloop_t.h"
 #include "iredges_t.h"
-#include "irbitset.h"
 #include "irprintf_t.h"
 #include "irtools.h"
 #include "util.h"
@@ -703,7 +702,7 @@ int co_get_lower_bound(const copy_opt_t *co)
 
 void co_complete_stats(const copy_opt_t *co, co_complete_stats_t *stat)
 {
-       bitset_t *seen = bitset_irg_malloc(co->irg);
+       bitset_t *seen = bitset_malloc(get_irg_last_idx(co->irg));
        affinity_node_t *an;
 
        memset(stat, 0, sizeof(stat[0]));
@@ -712,9 +711,9 @@ void co_complete_stats(const copy_opt_t *co, co_complete_stats_t *stat)
        co_gs_foreach_aff_node(co, an) {
                neighb_t *neigh;
                stat->aff_nodes += 1;
-               bitset_add_irn(seen, an->irn);
+               bitset_set(seen, get_irn_idx(an->irn));
                co_gs_foreach_neighb(an, neigh) {
-                       if (!bitset_contains_irn(seen, neigh->irn)) {
+                       if (!bitset_is_set(seen, get_irn_idx(neigh->irn))) {
                                stat->aff_edges += 1;
                                stat->max_costs += neigh->costs;
 
index cdfed37..fc1cc7d 100644 (file)
@@ -36,7 +36,6 @@
 #include "irnode_t.h"
 #include "irprintf.h"
 #include "irtools.h"
-#include "irbitset.h"
 #include "beifg.h"
 #include "error.h"
 #include "xmalloc.h"
@@ -374,13 +373,13 @@ static void int_comp_rec(be_ifg_t *ifg, ir_node *n, bitset_t *seen)
        ir_node *m;
 
        be_ifg_foreach_neighbour(ifg, &neigh_it, n, m) {
-               if (bitset_contains_irn(seen, m))
+               if (bitset_is_set(seen, get_irn_idx(m)))
                        continue;
 
                if (arch_get_irn_register_req(m)->type & arch_register_req_type_ignore)
                        continue;
 
-               bitset_add_irn(seen, m);
+               bitset_set(seen, get_irn_idx(m));
                int_comp_rec(ifg, m, seen);
        }
 
@@ -390,19 +389,19 @@ static int int_component_stat(ir_graph *irg, be_ifg_t *ifg)
 {
        int      n_comp    = 0;
        nodes_iter_t nodes_it;
-       bitset_t *seen     = bitset_irg_malloc(irg);
+       bitset_t *seen     = bitset_malloc(get_irg_last_idx(irg));
 
        ir_node *n;
 
        be_ifg_foreach_node(ifg, &nodes_it, n) {
-               if (bitset_contains_irn(seen, n))
+               if (bitset_is_set(seen, get_irn_idx(n)))
                        continue;
 
                if (arch_get_irn_register_req(n)->type & arch_register_req_type_ignore)
                        continue;
 
                ++n_comp;
-               bitset_add_irn(seen, n);
+               bitset_set(seen, get_irn_idx(n));
                int_comp_rec(ifg, n, seen);
        }
 
@@ -414,7 +413,7 @@ void be_ifg_stat(ir_graph *irg, be_ifg_t *ifg, be_ifg_stat_t *stat)
 {
        nodes_iter_t      nodes_it;
        neighbours_iter_t neigh_it;
-       bitset_t         *nodes    = bitset_irg_malloc(irg);
+       bitset_t         *nodes    = bitset_malloc(get_irg_last_idx(irg));
        ir_node          *n, *m;
 
        memset(stat, 0, sizeof(stat[0]));
@@ -422,8 +421,8 @@ void be_ifg_stat(ir_graph *irg, be_ifg_t *ifg, be_ifg_stat_t *stat)
        be_ifg_foreach_node(ifg, &nodes_it, n) {
                stat->n_nodes += 1;
                be_ifg_foreach_neighbour(ifg, &neigh_it, n, m) {
-                       bitset_add_irn(nodes, n);
-                       stat->n_edges += !bitset_contains_irn(nodes, m);
+                       bitset_set(nodes, get_irn_idx(n));
+                       stat->n_edges += !bitset_is_set(nodes, get_irn_idx(m));
                }
        }
 
index 88c01c2..1e52531 100644 (file)
@@ -31,7 +31,6 @@
 #include "iredges_t.h"
 #include "irgwalk.h"
 #include "irprintf_t.h"
-#include "irbitset.h"
 #include "irdump_t.h"
 #include "irnodeset.h"
 
@@ -356,8 +355,8 @@ static void live_end_at_block(ir_node *block, int is_true_out)
                mark_live_out(lv, block, def);
 
        visited = re.visited;
-       if (!bitset_contains_irn(visited, block)) {
-               bitset_add_irn(visited, block);
+       if (!bitset_is_set(visited, get_irn_idx(block))) {
+               bitset_set(visited, get_irn_idx(block));
 
                /*
                 * If this block is not the definition block, we have to go up
index 8e16494..a07de40 100644 (file)
@@ -38,7 +38,6 @@
 #include "irflag.h"
 #include "irgmod.h"
 #include "irgopt.h"
-#include "irbitset.h"
 #include "irgopt.h"
 #include "irdump.h"
 #include "pdeq.h"
index 1461d49..be4ec75 100644 (file)
@@ -34,7 +34,6 @@
 #include "irgmod.h"
 #include "irgwalk.h"
 #include "heights.h"
-#include "irbitset.h"
 #include "irprintf.h"
 #include "irdump.h"
 #include "error.h"
diff --git a/ir/ir/irbitset.h b/ir/ir/irbitset.h
deleted file mode 100644 (file)
index 1c59d7b..0000000
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * Copyright (C) 1995-2008 University of Karlsruhe.  All right reserved.
- *
- * This file is part of libFirm.
- *
- * This file may be distributed and/or modified under the terms of the
- * GNU General Public License version 2 as published by the Free Software
- * Foundation and appearing in the file LICENSE.GPL included in the
- * packaging of this file.
- *
- * Licensees holding valid libFirm Professional Edition licenses may use
- * this file in accordance with the libFirm Commercial License.
- * Agreement provided with the Software.
- *
- * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
- * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE.
- */
-
-/**
- * @file
- * @brief   Some convenience macros for node bitmaps.
- * @author  Sebastian Hack
- * @date    10.05.2006
- */
-#ifndef FIRM_IR_IRBITSET_H
-#define FIRM_IR_IRBITSET_H
-
-#include "bitset.h"
-
-#define bitset_irg_malloc(irg)                bitset_malloc(get_irg_last_idx(irg))
-#define bitset_irg_alloca(irg)                bitset_alloca(get_irg_last_idx(irg))
-#define bitset_irg_obstack_alloc(obst, irg)   bitset_obstack_alloc(obst, get_irg_last_idx(irg))
-#define bitset_add_irn(bs, irn)               bitset_set((bs), get_irn_idx(irn))
-#define bitset_remv_irn(bs, irn)              bitset_clear((bs), get_irn_idx(irn))
-#define bitset_contains_irn(bs, irn)          bitset_is_set((bs), get_irn_idx(irn))
-
-
-/* Internal use. */
-#define bsfe_get_irn_(irg, elm) (elm == (unsigned) -1 ? NULL : get_idx_irn((irg), (unsigned) elm))
-
-/**
- * Iterate over a bitset containing node indexes.
- * @param irg The graph the nodes are in.
- * @param bs  The bitset containing the indexes.
- * @param elm A loop variable for the bitset
- * @param irn An ir_node * which is set to the current node.
- */
-#define bitset_foreach_irn(irg, bs, elm, irn) \
-       for(elm = bitset_next_set(bs, 0), irn = bsfe_get_irn_(irg, elm); elm != (unsigned) -1; elm = bitset_next_set(bs, elm + 1), irn = bsfe_get_irn_(irg, elm))
-
-
-#endif