Commit 1beb0be5 authored by Matthias Braun's avatar Matthias Braun
Browse files

Avoid direct op->ops accesses

parent 0ef534e6
......@@ -138,12 +138,12 @@ void be_info_init(void)
panic("double initialization of be_info");
old_phi_copy_attr = op_Phi->ops.copy_attr;
op_Phi->ops.copy_attr = new_phi_copy_attr;
set_op_copy_attr(op_Phi, new_phi_copy_attr);
initialized = true;
/* phis have register and register requirements now which we want to dump */
assert(op_Phi->ops.dump_node == NULL);
op_Phi->ops.dump_node = be_dump_phi_reg_reqs;
set_op_dump(op_Phi, be_dump_phi_reg_reqs);
hook_liveness_info.hook._hook_node_info = dump_liveness_info_hook;
register_hook(hook_node_info, &hook_liveness_info);
......@@ -189,7 +189,7 @@ void be_info_free(void)
initialized = false;
assert(op_Phi->ops.dump_node == be_dump_phi_reg_reqs);
op_Phi->ops.dump_node = NULL;
set_op_dump(op_Phi, NULL);
unregister_hook(hook_node_info, &hook_liveness_info);
}
......@@ -705,8 +705,8 @@ static ir_op *new_be_op(unsigned code, const char *name, op_pin_state p,
irop_flags flags, op_arity opar, size_t attr_size)
{
ir_op *res = new_ir_op(code, name, p, flags, opar, 0, attr_size);
res->ops.dump_node = dump_node;
res->ops.copy_attr = copy_attr;
set_op_dump(res, dump_node);
set_op_copy_attr(res, copy_attr);
res->ops.be_ops = &be_node_irn_ops;
set_op_tag(res, be_op_tag);
return res;
......
......@@ -623,7 +623,7 @@ EOF
$temp .= ", ".translate_arity($arity).", -1, ${attr_size});\n";
$obst_new_irop .= $temp;
$obst_new_irop .= "\top->ops.be_ops = be_ops;\n";
$obst_new_irop .= "\top->ops.dump_node = ${dump_func};\n";
$obst_new_irop .= "\tset_op_dump(op, ${dump_func});\n";
if (defined($attrs_equal_func)) {
$obst_new_irop .= "\tset_op_attrs_equal(op, ${attrs_equal_func});\n";
}
......@@ -635,10 +635,10 @@ EOF
}
}
if (defined($copy_attr_func)) {
$obst_new_irop .= "\top->ops.copy_attr = ${copy_attr_func};\n";
$obst_new_irop .= "\tset_op_copy_attr(op, ${copy_attr_func});\n";
}
if (defined($hash_func)) {
$obst_new_irop .= "\top->ops.hash = ${hash_func};\n";
$obst_new_irop .= "\tset_op_hash(op, ${hash_func});\n";
}
if ($is_fragile) {
......
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