Commit 7cf36894 authored by Matthias Braun's avatar Matthias Braun
Browse files

redo reverted changes to new set_transformer interface in sparc_transform.c

[r27748]
parent 4a97bde7
......@@ -1125,104 +1125,45 @@ static ir_node *gen_Jmp(ir_node *node)
return new_bd_sparc_Jmp(dbgi, new_block);
}
/**
* the BAD transformer.
*/
static ir_node *bad_transform(ir_node *irn)
{
panic("SPARC backend: Not implemented: %+F", irn);
}
/**
* Set a node emitter. Make it a bit more type safe.
*/
static void set_transformer(ir_op *op, be_transform_func sparc_transform_func)
{
op->ops.generic = (op_func)sparc_transform_func;
}
/**
* configure transformation callbacks
*/
void sparc_register_transformers(void)
{
clear_irp_opcodes_generic_func();
set_transformer(op_Add, gen_Add);
set_transformer(op_Store, gen_Store);
set_transformer(op_Const, gen_Const);
set_transformer(op_Load, gen_Load);
set_transformer(op_Sub, gen_Sub);
set_transformer(op_be_AddSP, gen_be_AddSP);
set_transformer(op_be_SubSP, gen_be_SubSP);
set_transformer(op_be_Copy, gen_be_Copy);
set_transformer(op_be_Call, gen_be_Call);
set_transformer(op_be_FrameAddr, gen_be_FrameAddr);
set_transformer(op_Cond, gen_Cond);
set_transformer(op_Cmp, gen_Cmp);
set_transformer(op_SymConst, gen_SymConst);
set_transformer(op_Phi, gen_Phi);
set_transformer(op_Proj, gen_Proj);
set_transformer(op_Conv, gen_Conv);
set_transformer(op_Jmp, gen_Jmp);
set_transformer(op_Mul, gen_Mul);
set_transformer(op_Mulh, gen_Mulh);
set_transformer(op_Div, gen_Div);
set_transformer(op_Abs, gen_Abs);
set_transformer(op_Shl, gen_Shl);
set_transformer(op_Shr, gen_Shr);
set_transformer(op_Shrs, gen_Shra);
set_transformer(op_Minus, gen_Minus);
set_transformer(op_Not, gen_Not);
set_transformer(op_And, gen_And);
set_transformer(op_Or, gen_Or);
set_transformer(op_Eor, gen_Xor);
set_transformer(op_Unknown, gen_Unknown);
/* node list */
/*
set_transformer(op_CopyB, gen_CopyB);
set_transformer(op_Quot, gen_Quot);
set_transformer(op_Rotl, gen_Rotl);
*/
set_transformer(op_ASM, bad_transform);
set_transformer(op_Builtin, bad_transform);
set_transformer(op_CallBegin, bad_transform);
set_transformer(op_Cast, bad_transform);
set_transformer(op_Confirm, bad_transform);
set_transformer(op_DivMod, bad_transform);
set_transformer(op_EndExcept, bad_transform);
set_transformer(op_EndReg, bad_transform);
set_transformer(op_Filter, bad_transform);
set_transformer(op_Free, bad_transform);
set_transformer(op_Id, bad_transform);
set_transformer(op_InstOf, bad_transform);
set_transformer(op_Mux, bad_transform);
set_transformer(op_Raise, bad_transform);
set_transformer(op_Sel, bad_transform);
set_transformer(op_Tuple, bad_transform);
}
/**
* Pre-transform all unknown nodes.
*/
static void sparc_pretransform_node(void)
{
sparc_code_gen_t *cg = env_cg;
(void) cg;
//cg->unknown_gp = be_pre_transform_node(cg->unknown_gp);
//cg->unknown_fpa = be_pre_transform_node(cg->unknown_fpa);
be_start_transform_setup();
be_set_transform_function(op_Abs, gen_Abs);
be_set_transform_function(op_Add, gen_Add);
be_set_transform_function(op_And, gen_And);
be_set_transform_function(op_be_AddSP, gen_be_AddSP);
be_set_transform_function(op_be_Call, gen_be_Call);
be_set_transform_function(op_be_Copy, gen_be_Copy);
be_set_transform_function(op_be_FrameAddr, gen_be_FrameAddr);
be_set_transform_function(op_be_SubSP, gen_be_SubSP);
be_set_transform_function(op_Cmp, gen_Cmp);
be_set_transform_function(op_Cond, gen_Cond);
be_set_transform_function(op_Const, gen_Const);
be_set_transform_function(op_Conv, gen_Conv);
be_set_transform_function(op_Div, gen_Div);
be_set_transform_function(op_Eor, gen_Xor);
be_set_transform_function(op_Jmp, gen_Jmp);
be_set_transform_function(op_Load, gen_Load);
be_set_transform_function(op_Minus, gen_Minus);
be_set_transform_function(op_Mul, gen_Mul);
be_set_transform_function(op_Mulh, gen_Mulh);
be_set_transform_function(op_Not, gen_Not);
be_set_transform_function(op_Or, gen_Or);
be_set_transform_function(op_Phi, gen_Phi);
be_set_transform_function(op_Proj, gen_Proj);
be_set_transform_function(op_Shl, gen_Shl);
be_set_transform_function(op_Shr, gen_Shr);
be_set_transform_function(op_Shrs, gen_Shra);
be_set_transform_function(op_Store, gen_Store);
be_set_transform_function(op_Sub, gen_Sub);
be_set_transform_function(op_SymConst, gen_SymConst);
be_set_transform_function(op_Unknown, gen_Unknown);
be_set_transform_function(op_sparc_Save, be_duplicate_node);
}
/**
......@@ -1232,7 +1173,7 @@ void sparc_transform_graph(sparc_code_gen_t *cg)
{
sparc_register_transformers();
env_cg = cg;
be_transform_graph(cg->irg, sparc_pretransform_node);
be_transform_graph(cg->irg, NULL);
}
void sparc_init_transform(void)
......
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