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) {
/**
* Pre-transform all unknown nodes.
*/
static void arm_pretransform_node(void *arch_cg) {
arm_code_gen_t *cg = arch_cg;
static void arm_pretransform_node(void)
{
arm_code_gen_t *cg = env_cg;
cg->unknown_gp = be_pre_transform_node(cg->unknown_gp);
cg->unknown_fpa = be_pre_transform_node(cg->unknown_fpa);
......@@ -1764,7 +1765,7 @@ void arm_transform_graph(arm_code_gen_t *cg) {
}
arm_register_transformers();
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) {
......
......@@ -253,8 +253,7 @@ static void kill_unused_anchor(int anchor)
/**
* Transforms all nodes. Deletes the old obstack and creates a new one.
*/
static void transform_nodes(ir_graph *irg, arch_pretrans_nodes *pre_transform,
void *cg)
static void transform_nodes(ir_graph *irg, arch_pretrans_nodes *pre_transform)
{
int i;
ir_node *old_end, *new_anchor;
......@@ -291,7 +290,7 @@ static void transform_nodes(ir_graph *irg, arch_pretrans_nodes *pre_transform,
kill_unused_anchor(anchor_tls);
if (pre_transform)
(*pre_transform)(cg);
pre_transform();
/* process worklist (this should transform all nodes in the graph) */
while (! waitq_empty(env.worklist)) {
......@@ -384,7 +383,7 @@ static ir_node *gen_End(ir_node *node) {
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 *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)
op_End->ops.generic = (op_func)gen_End;
/* do the main transformation */
transform_nodes(irg, func, cg);
transform_nodes(irg, func);
/* free the old obstack */
obstack_free(old_obst, 0);
......
......@@ -33,7 +33,7 @@
/**
* 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.
......@@ -76,6 +76,6 @@ void be_enqueue_preds(ir_node *node);
/**
* 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 */
......@@ -4641,8 +4641,9 @@ static void register_transformers(void)
/**
* Pre-transform all unknown and noreg nodes.
*/
static void ia32_pretransform_node(void *arch_cg) {
ia32_code_gen_t *cg = arch_cg;
static void ia32_pretransform_node(void)
{
ia32_code_gen_t *cg = env_cg;
cg->unknown_gp = be_pre_transform_node(cg->unknown_gp);
cg->unknown_vfp = be_pre_transform_node(cg->unknown_vfp);
......@@ -4758,7 +4759,7 @@ void ia32_transform_graph(ia32_code_gen_t *cg)
cse_last = get_opt_cse();
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);
......
......@@ -1173,7 +1173,7 @@ void mips_transform_graph(mips_code_gen_t *cg)
{
env_cg = cg;
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