projects
/
libfirm
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
a9132de
)
Let be_foreach_definition() declare the value variable.
author
Christoph Mallon
<christoph.mallon@gmx.de>
Tue, 13 Nov 2012 09:12:55 +0000
(10:12 +0100)
committer
Christoph Mallon
<christoph.mallon@gmx.de>
Tue, 13 Nov 2012 09:12:55 +0000
(10:12 +0100)
ir/be/bearch.h
patch
|
blob
|
history
ir/be/belive.c
patch
|
blob
|
history
ir/be/beprefalloc.c
patch
|
blob
|
history
ir/be/bespill.c
patch
|
blob
|
history
ir/be/bespillbelady.c
patch
|
blob
|
history
ir/be/bespilldaemel.c
patch
|
blob
|
history
diff --git
a/ir/be/bearch.h
b/ir/be/bearch.h
index
87f94aa
..
bb80037
100644
(file)
--- a/
ir/be/bearch.h
+++ b/
ir/be/bearch.h
@@
-609,16
+609,15
@@
static inline bool arch_irn_consider_in_reg_alloc(
do { \
if (get_irn_mode(node) == mode_T) { \
foreach_out_edge(node, edge_) { \
do { \
if (get_irn_mode(node) == mode_T) { \
foreach_out_edge(node, edge_) { \
- const arch_register_req_t *req_; \
- value = get_edge_src_irn(edge_); \
- req_ = arch_get_irn_register_req(value); \
+ ir_node *const value = get_edge_src_irn(edge_); \
+ arch_register_req_t const *const req_ = arch_get_irn_register_req(value); \
if (req_->cls != ccls) \
continue; \
code \
} \
} else { \
if (req_->cls != ccls) \
continue; \
code \
} \
} else { \
-
const arch_register_req_t *req_
= arch_get_irn_register_req(node); \
-
value = node;
\
+
arch_register_req_t const *const req_
= arch_get_irn_register_req(node); \
+
ir_node *const value = node;
\
if (req_->cls == ccls) { \
code \
} \
if (req_->cls == ccls) { \
code \
} \
diff --git
a/ir/be/belive.c
b/ir/be/belive.c
index
8ab7a8d
..
687788b
100644
(file)
--- a/
ir/be/belive.c
+++ b/
ir/be/belive.c
@@
-513,7
+513,6
@@
void be_liveness_transfer(const arch_register_class_t *cls,
* function. */
assert(!is_Phi(node) && "liveness_transfer produces invalid results for phi nodes");
* function. */
assert(!is_Phi(node) && "liveness_transfer produces invalid results for phi nodes");
- ir_node *value;
be_foreach_definition(node, cls, value,
ir_nodeset_remove(nodeset, value);
);
be_foreach_definition(node, cls, value,
ir_nodeset_remove(nodeset, value);
);
diff --git
a/ir/be/beprefalloc.c
b/ir/be/beprefalloc.c
index
34564e1
..
6cb9a31
100644
(file)
--- a/
ir/be/beprefalloc.c
+++ b/
ir/be/beprefalloc.c
@@
-306,7
+306,6
@@
static void analyze_block(ir_node *block, void *data)
if (is_Phi(node))
break;
if (is_Phi(node))
break;
- ir_node *value;
be_foreach_definition(node, cls, value,
check_defs(&live_nodes, weight, value);
);
be_foreach_definition(node, cls, value,
check_defs(&live_nodes, weight, value);
);
@@
-410,7
+409,6
@@
static void create_congruence_class(ir_node *block, void *data)
/* check should be same constraints */
ir_node *last_phi = NULL;
sched_foreach_reverse(block, node) {
/* check should be same constraints */
ir_node *last_phi = NULL;
sched_foreach_reverse(block, node) {
- ir_node *value;
if (is_Phi(node)) {
last_phi = node;
break;
if (is_Phi(node)) {
last_phi = node;
break;
@@
-1200,9
+1198,9
@@
static void enforce_constraints(ir_nodeset_t *live_nodes, ir_node *node,
}
/* is any of the live-throughs using a constrained output register? */
}
/* is any of the live-throughs using a constrained output register? */
- ir_node *value;
unsigned *live_through_regs = NULL;
be_foreach_definition(node, cls, value,
unsigned *live_through_regs = NULL;
be_foreach_definition(node, cls, value,
+ (void)value;
if (req_->width > 1)
double_width = true;
if (! (req_->type & arch_register_req_type_limited))
if (req_->width > 1)
double_width = true;
if (! (req_->type & arch_register_req_type_limited))
@@
-1696,7
+1694,6
@@
static void allocate_coalesce_block(ir_node *block, void *data)
free_last_uses(&live_nodes, node);
/* assign output registers */
free_last_uses(&live_nodes, node);
/* assign output registers */
- ir_node *value;
be_foreach_definition_(node, cls, value,
assign_reg(block, value, forbidden_regs);
);
be_foreach_definition_(node, cls, value,
assign_reg(block, value, forbidden_regs);
);
diff --git
a/ir/be/bespill.c
b/ir/be/bespill.c
index
00e0798
..
f56b745
100644
(file)
--- a/
ir/be/bespill.c
+++ b/
ir/be/bespill.c
@@
-63,7
+63,6
@@
static void prepare_constr_insn(be_pre_spill_env_t *env, ir_node *node)
unsigned *tmp = NULL;
unsigned *def_constr = NULL;
int arity = get_irn_arity(node);
unsigned *tmp = NULL;
unsigned *def_constr = NULL;
int arity = get_irn_arity(node);
- ir_node *def;
int i, i2;
int i, i2;
@@
-153,6
+152,7
@@
static void prepare_constr_insn(be_pre_spill_env_t *env, ir_node *node)
/* collect all registers occurring in out constraints. */
be_foreach_definition(node, cls, def,
/* collect all registers occurring in out constraints. */
be_foreach_definition(node, cls, def,
+ (void)def;
if (! (req_->type & arch_register_req_type_limited))
continue;
if (def_constr == NULL) {
if (! (req_->type & arch_register_req_type_limited))
continue;
if (def_constr == NULL) {
diff --git
a/ir/be/bespillbelady.c
b/ir/be/bespillbelady.c
index
f205aa5
..
658b34d
100644
(file)
--- a/
ir/be/bespillbelady.c
+++ b/
ir/be/bespillbelady.c
@@
-805,7
+805,6
@@
static void process_block(ir_node *block)
sched_foreach(block, irn) {
int i, arity;
sched_foreach(block, irn) {
int i, arity;
- ir_node *value;
assert(workset_get_length(ws) <= n_regs);
/* Phis are no real instr (see insert_starters()) */
assert(workset_get_length(ws) <= n_regs);
/* Phis are no real instr (see insert_starters()) */
diff --git
a/ir/be/bespilldaemel.c
b/ir/be/bespilldaemel.c
index
e3bfdbd
..
f25977c
100644
(file)
--- a/
ir/be/bespilldaemel.c
+++ b/
ir/be/bespilldaemel.c
@@
-140,9
+140,9
@@
static unsigned get_value_width(const ir_node *node)
*/
static void do_spilling(ir_nodeset_t *live_nodes, ir_node *node)
{
*/
static void do_spilling(ir_nodeset_t *live_nodes, ir_node *node)
{
- size_t values_defined = 0;
- ir_node *value;
+ size_t values_defined = 0;
be_foreach_definition(node, cls, value,
be_foreach_definition(node, cls, value,
+ (void)value;
assert(req_->width >= 1);
values_defined += req_->width;
);
assert(req_->width >= 1);
values_defined += req_->width;
);
@@
-228,7
+228,6
@@
static void remove_defs(ir_node *node, ir_nodeset_t *nodeset)
/* You must break out of your loop when hitting the first phi function. */
assert(!is_Phi(node));
/* You must break out of your loop when hitting the first phi function. */
assert(!is_Phi(node));
- ir_node *value;
be_foreach_definition(node, cls, value,
ir_nodeset_remove(nodeset, value);
);
be_foreach_definition(node, cls, value,
ir_nodeset_remove(nodeset, value);
);