projects
/
libfirm
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
8a5ac70
)
Let co_gs_foreach_neighb() declare the iterator variable.
author
Christoph Mallon
<christoph.mallon@gmx.de>
Fri, 13 Jul 2012 06:48:34 +0000
(08:48 +0200)
committer
Christoph Mallon
<christoph.mallon@gmx.de>
Fri, 13 Jul 2012 21:03:56 +0000
(23:03 +0200)
ir/be/becopyheur2.c
patch
|
blob
|
history
ir/be/becopyheur4.c
patch
|
blob
|
history
ir/be/becopyilp2.c
patch
|
blob
|
history
ir/be/becopyopt.c
patch
|
blob
|
history
ir/be/becopyopt_t.h
patch
|
blob
|
history
ir/be/bedump.c
patch
|
blob
|
history
diff --git
a/ir/be/becopyheur2.c
b/ir/be/becopyheur2.c
index
7a1a00a
..
8a01a12
100644
(file)
--- a/
ir/be/becopyheur2.c
+++ b/
ir/be/becopyheur2.c
@@
-352,8
+352,6
@@
static void determine_color_costs(co2_t *env, co2_irn_t *ci, col_cost_pair_t *co
}
if (a) {
}
if (a) {
- neighb_t *n;
-
co_gs_foreach_neighb(a, n) {
if (color_is_fix(env, n->irn)) {
col_t col = get_col(env, n->irn);
co_gs_foreach_neighb(a, n) {
if (color_is_fix(env, n->irn)) {
col_t col = get_col(env, n->irn);
@@
-780,7
+778,6
@@
static void populate_cloud(co2_t *env, co2_cloud_t *cloud, affinity_node_t *a, i
be_ifg_t *ifg = env->co->cenv->ifg;
co2_cloud_irn_t *ci = get_co2_cloud_irn(env, a->irn);
int costs = 0;
be_ifg_t *ifg = env->co->cenv->ifg;
co2_cloud_irn_t *ci = get_co2_cloud_irn(env, a->irn);
int costs = 0;
- neighb_t *n;
if (ci->cloud)
return;
if (ci->cloud)
return;
@@
-893,7
+890,6
@@
static void process_cloud(co2_cloud_t *cloud)
obstack_init(&cloud->obst);
for (i = 0; i < cloud->n_memb; ++i) {
co2_cloud_irn_t *ci = cloud->seq[i];
obstack_init(&cloud->obst);
for (i = 0; i < cloud->n_memb; ++i) {
co2_cloud_irn_t *ci = cloud->seq[i];
- neighb_t *n;
co_gs_foreach_neighb(ci->inh.aff, n) {
co2_cloud_irn_t *ni = get_co2_cloud_irn(cloud->env, n->irn);
co_gs_foreach_neighb(ci->inh.aff, n) {
co2_cloud_irn_t *ni = get_co2_cloud_irn(cloud->env, n->irn);
@@
-1010,7
+1006,6
@@
static void process_cloud(co2_cloud_t *cloud)
static int cloud_costs(co2_cloud_t *cloud)
{
int i, costs = 0;
static int cloud_costs(co2_cloud_t *cloud)
{
int i, costs = 0;
- neighb_t *n;
for (i = 0; i < cloud->n_memb; ++i) {
co2_irn_t *ci = (co2_irn_t *) cloud->seq[i];
for (i = 0; i < cloud->n_memb; ++i) {
co2_irn_t *ci = (co2_irn_t *) cloud->seq[i];
diff --git
a/ir/be/becopyheur4.c
b/ir/be/becopyheur4.c
index
47ceb98
..
74ce835
100644
(file)
--- a/
ir/be/becopyheur4.c
+++ b/
ir/be/becopyheur4.c
@@
-589,7
+589,6
@@
static void aff_chunk_assure_weight(co_mst_env_t *env, aff_chunk_t *c)
}
if (an != NULL) {
}
if (an != NULL) {
- neighb_t *neigh;
co_gs_foreach_neighb(an, neigh) {
const ir_node *m = neigh->irn;
co_gs_foreach_neighb(an, neigh) {
const ir_node *m = neigh->irn;
@@
-615,7
+614,6
@@
static void aff_chunk_assure_weight(co_mst_env_t *env, aff_chunk_t *c)
*/
static int count_interfering_aff_neighs(co_mst_env_t *env, const affinity_node_t *an)
{
*/
static int count_interfering_aff_neighs(co_mst_env_t *env, const affinity_node_t *an)
{
- const neighb_t *neigh;
const ir_node *irn = an->irn;
const co_mst_irn_t *node = get_co_mst_irn(env, irn);
int res = 0;
const ir_node *irn = an->irn;
const co_mst_irn_t *node = get_co_mst_irn(env, irn);
int res = 0;
@@
-668,8
+666,6
@@
static void build_affinity_chunks(co_mst_env_t *env)
an = get_affinity_info(env->co, n);
if (an != NULL) {
an = get_affinity_info(env->co, n);
if (an != NULL) {
- neighb_t *neigh;
-
if (n1->int_aff_neigh < 0)
n1->int_aff_neigh = count_interfering_aff_neighs(env, an);
if (n1->int_aff_neigh < 0)
n1->int_aff_neigh = count_interfering_aff_neighs(env, an);
@@
-760,7
+756,6
@@
static __attribute__((unused)) void chunk_order_nodes(co_mst_env_t *env, aff_chu
const ir_node *irn = chunk->n[--i];
affinity_node_t *an = get_affinity_info(env->co, irn);
int w = 0;
const ir_node *irn = chunk->n[--i];
affinity_node_t *an = get_affinity_info(env->co, irn);
int w = 0;
- neighb_t *neigh;
if (arch_irn_is_ignore(irn))
continue;
if (arch_irn_is_ignore(irn))
continue;
@@
-788,7
+783,6
@@
static __attribute__((unused)) void chunk_order_nodes(co_mst_env_t *env, aff_chu
while (!pqueue_empty(grow)) {
ir_node *irn = (ir_node*)pqueue_pop_front(grow);
affinity_node_t *an = get_affinity_info(env->co, irn);
while (!pqueue_empty(grow)) {
ir_node *irn = (ir_node*)pqueue_pop_front(grow);
affinity_node_t *an = get_affinity_info(env->co, irn);
- neighb_t *neigh;
if (arch_irn_is_ignore(irn))
continue;
if (arch_irn_is_ignore(irn))
continue;
@@
-837,7
+831,6
@@
static void expand_chunk_from(co_mst_env_t *env, co_mst_irn_t *node, bitset_t *v
/* check all affinity neighbors */
if (an != NULL) {
/* check all affinity neighbors */
if (an != NULL) {
- neighb_t *neigh;
co_gs_foreach_neighb(an, neigh) {
const ir_node *m = neigh->irn;
int m_idx = get_irn_idx(m);
co_gs_foreach_neighb(an, neigh) {
const ir_node *m = neigh->irn;
int m_idx = get_irn_idx(m);
diff --git
a/ir/be/becopyilp2.c
b/ir/be/becopyilp2.c
index
2f7e752
..
664f559
100644
(file)
--- a/
ir/be/becopyilp2.c
+++ b/
ir/be/becopyilp2.c
@@
-360,7
+360,6
@@
static void build_clique_star_cstr(ilp_env_t *ienv)
/* for each node with affinity edges */
co_gs_foreach_aff_node(ienv->co, aff) {
struct obstack ob;
/* for each node with affinity edges */
co_gs_foreach_aff_node(ienv->co, aff) {
struct obstack ob;
- neighb_t *nbr;
const ir_node *center = aff->irn;
ir_node **nodes;
set *edges;
const ir_node *center = aff->irn;
ir_node **nodes;
set *edges;
@@
-476,7
+475,6
@@
static void extend_path(ilp_env_t *ienv, pdeq *path, const ir_node *irn)
int i, len;
ir_node **curr_path;
affinity_node_t *aff;
int i, len;
ir_node **curr_path;
affinity_node_t *aff;
- neighb_t *nbr;
/* do not walk backwards or in circles */
if (pdeq_contains(path, irn))
/* do not walk backwards or in circles */
if (pdeq_contains(path, irn))
diff --git
a/ir/be/becopyopt.c
b/ir/be/becopyopt.c
index
758f1ea
..
65abc6b
100644
(file)
--- a/
ir/be/becopyopt.c
+++ b/
ir/be/becopyopt.c
@@
-732,7
+732,6
@@
void co_complete_stats(const copy_opt_t *co, co_complete_stats_t *stat)
/* count affinity edges. */
co_gs_foreach_aff_node(co, an) {
/* count affinity edges. */
co_gs_foreach_aff_node(co, an) {
- neighb_t *neigh;
stat->aff_nodes += 1;
bitset_set(seen, get_irn_idx(an->irn));
co_gs_foreach_neighb(an, neigh) {
stat->aff_nodes += 1;
bitset_set(seen, get_irn_idx(an->irn));
co_gs_foreach_neighb(an, neigh) {
@@
-974,8
+973,6
@@
static void co_dump_appel_graph(const copy_opt_t *co, FILE *f)
}
if (a) {
}
if (a) {
- neighb_t *n;
-
co_gs_foreach_neighb(a, n) {
if (!arch_irn_is_ignore(n->irn)) {
int n_idx = node_map[get_irn_idx(n->irn)];
co_gs_foreach_neighb(a, n) {
if (!arch_irn_is_ignore(n->irn)) {
int n_idx = node_map[get_irn_idx(n->irn)];
diff --git
a/ir/be/becopyopt_t.h
b/ir/be/becopyopt_t.h
index
e32ae71
..
56f3da7
100644
(file)
--- a/
ir/be/becopyopt_t.h
+++ b/
ir/be/becopyopt_t.h
@@
-150,6
+150,6
@@
static inline affinity_node_t *get_affinity_info(const copy_opt_t *co, const ir_
}
#define co_gs_foreach_aff_node(co, aff_node) foreach_set((co)->nodes, affinity_node_t, (aff_node))
}
#define co_gs_foreach_aff_node(co, aff_node) foreach_set((co)->nodes, affinity_node_t, (aff_node))
-#define co_gs_foreach_neighb(aff_node, neighb) for (neighb
= aff_node->neighbours; neighb != NULL
; neighb = neighb->next)
+#define co_gs_foreach_neighb(aff_node, neighb) for (neighb
_t *neighb = aff_node->neighbours; neighb
; neighb = neighb->next)
#endif /* FIRM_BE_BECOPYOPT_T_H */
#endif /* FIRM_BE_BECOPYOPT_T_H */
diff --git
a/ir/be/bedump.c
b/ir/be/bedump.c
index
33ece8c
..
4952fd2
100644
(file)
--- a/
ir/be/bedump.c
+++ b/
ir/be/bedump.c
@@
-85,8
+85,6
@@
static void dump_affinity_edges(FILE *F, const copy_opt_t *co,
bool dump_costs, bool dump_colors)
{
co_gs_foreach_aff_node(co, a) {
bool dump_costs, bool dump_colors)
{
co_gs_foreach_aff_node(co, a) {
- neighb_t *n;
-
co_gs_foreach_neighb(a, n) {
/* edges are bidirection, dumping one direction is enough */
if (get_irn_node_nr(a->irn) >= get_irn_node_nr(n->irn))
co_gs_foreach_neighb(a, n) {
/* edges are bidirection, dumping one direction is enough */
if (get_irn_node_nr(a->irn) >= get_irn_node_nr(n->irn))