Commit 87283842 authored by Christoph Mallon's avatar Christoph Mallon
Browse files

Do not pass the cg to transform_nodes().

[r22622]
parent f5a5ca65
...@@ -1712,8 +1712,9 @@ static void arm_register_transformers(void) { ...@@ -1712,8 +1712,9 @@ static void arm_register_transformers(void) {
/** /**
* Pre-transform all unknown nodes. * Pre-transform all unknown nodes.
*/ */
static void arm_pretransform_node(void *arch_cg) { static void arm_pretransform_node(void)
arm_code_gen_t *cg = arch_cg; {
arm_code_gen_t *cg = env_cg;
cg->unknown_gp = be_pre_transform_node(cg->unknown_gp); cg->unknown_gp = be_pre_transform_node(cg->unknown_gp);
cg->unknown_fpa = be_pre_transform_node(cg->unknown_fpa); cg->unknown_fpa = be_pre_transform_node(cg->unknown_fpa);
...@@ -1764,7 +1765,7 @@ void arm_transform_graph(arm_code_gen_t *cg) { ...@@ -1764,7 +1765,7 @@ void arm_transform_graph(arm_code_gen_t *cg) {
} }
arm_register_transformers(); arm_register_transformers();
env_cg = cg; env_cg = cg;
be_transform_graph(cg->birg, arm_pretransform_node, cg); be_transform_graph(cg->birg, arm_pretransform_node);
} }
void arm_init_transform(void) { void arm_init_transform(void) {
......
...@@ -253,8 +253,7 @@ static void kill_unused_anchor(int anchor) ...@@ -253,8 +253,7 @@ static void kill_unused_anchor(int anchor)
/** /**
* Transforms all nodes. Deletes the old obstack and creates a new one. * Transforms all nodes. Deletes the old obstack and creates a new one.
*/ */
static void transform_nodes(ir_graph *irg, arch_pretrans_nodes *pre_transform, static void transform_nodes(ir_graph *irg, arch_pretrans_nodes *pre_transform)
void *cg)
{ {
int i; int i;
ir_node *old_end, *new_anchor; ir_node *old_end, *new_anchor;
...@@ -291,7 +290,7 @@ static void transform_nodes(ir_graph *irg, arch_pretrans_nodes *pre_transform, ...@@ -291,7 +290,7 @@ static void transform_nodes(ir_graph *irg, arch_pretrans_nodes *pre_transform,
kill_unused_anchor(anchor_tls); kill_unused_anchor(anchor_tls);
if (pre_transform) if (pre_transform)
(*pre_transform)(cg); pre_transform();
/* process worklist (this should transform all nodes in the graph) */ /* process worklist (this should transform all nodes in the graph) */
while (! waitq_empty(env.worklist)) { while (! waitq_empty(env.worklist)) {
...@@ -384,7 +383,7 @@ static ir_node *gen_End(ir_node *node) { ...@@ -384,7 +383,7 @@ static ir_node *gen_End(ir_node *node) {
return new_end; return new_end;
} }
void be_transform_graph(be_irg_t *birg, arch_pretrans_nodes *func, void *cg) void be_transform_graph(be_irg_t *birg, arch_pretrans_nodes *func)
{ {
ir_graph *irg = birg->irg; ir_graph *irg = birg->irg;
ir_graph *old_current_ir_graph = current_ir_graph; ir_graph *old_current_ir_graph = current_ir_graph;
...@@ -409,7 +408,7 @@ void be_transform_graph(be_irg_t *birg, arch_pretrans_nodes *func, void *cg) ...@@ -409,7 +408,7 @@ void be_transform_graph(be_irg_t *birg, arch_pretrans_nodes *func, void *cg)
op_End->ops.generic = (op_func)gen_End; op_End->ops.generic = (op_func)gen_End;
/* do the main transformation */ /* do the main transformation */
transform_nodes(irg, func, cg); transform_nodes(irg, func);
/* free the old obstack */ /* free the old obstack */
obstack_free(old_obst, 0); obstack_free(old_obst, 0);
......
...@@ -33,7 +33,7 @@ ...@@ -33,7 +33,7 @@
/** /**
* A callback to pre-transform some nodes before the transformation starts. * A callback to pre-transform some nodes before the transformation starts.
*/ */
typedef void (arch_pretrans_nodes)(void *arch_cg); typedef void (arch_pretrans_nodes)(void);
/** /**
* The type of a transform function. * The type of a transform function.
...@@ -76,6 +76,6 @@ void be_enqueue_preds(ir_node *node); ...@@ -76,6 +76,6 @@ void be_enqueue_preds(ir_node *node);
/** /**
* Transform a graph. Transformers must be registered first. * Transform a graph. Transformers must be registered first.
*/ */
void be_transform_graph(be_irg_t *birg, arch_pretrans_nodes *func, void *cg_env); void be_transform_graph(be_irg_t *birg, arch_pretrans_nodes *func);
#endif /* FIRM_BE_BETRANSHLP_H */ #endif /* FIRM_BE_BETRANSHLP_H */
...@@ -4641,8 +4641,9 @@ static void register_transformers(void) ...@@ -4641,8 +4641,9 @@ static void register_transformers(void)
/** /**
* Pre-transform all unknown and noreg nodes. * Pre-transform all unknown and noreg nodes.
*/ */
static void ia32_pretransform_node(void *arch_cg) { static void ia32_pretransform_node(void)
ia32_code_gen_t *cg = arch_cg; {
ia32_code_gen_t *cg = env_cg;
cg->unknown_gp = be_pre_transform_node(cg->unknown_gp); cg->unknown_gp = be_pre_transform_node(cg->unknown_gp);
cg->unknown_vfp = be_pre_transform_node(cg->unknown_vfp); cg->unknown_vfp = be_pre_transform_node(cg->unknown_vfp);
...@@ -4758,7 +4759,7 @@ void ia32_transform_graph(ia32_code_gen_t *cg) ...@@ -4758,7 +4759,7 @@ void ia32_transform_graph(ia32_code_gen_t *cg)
cse_last = get_opt_cse(); cse_last = get_opt_cse();
set_opt_cse(0); set_opt_cse(0);
be_transform_graph(cg->birg, ia32_pretransform_node, cg); be_transform_graph(cg->birg, ia32_pretransform_node);
set_opt_cse(cse_last); set_opt_cse(cse_last);
......
...@@ -1173,7 +1173,7 @@ void mips_transform_graph(mips_code_gen_t *cg) ...@@ -1173,7 +1173,7 @@ void mips_transform_graph(mips_code_gen_t *cg)
{ {
env_cg = cg; env_cg = cg;
register_transformers(); register_transformers();
be_transform_graph(cg->birg, NULL, cg); be_transform_graph(cg->birg, NULL);
} }
/** /**
......
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