Commit 48feaf06 authored by Christoph Mallon's avatar Christoph Mallon
Browse files

irop: Provide macro wrappers for [gs]et_generic_function_ptr_().

parent 11b00882
...@@ -938,11 +938,11 @@ static void write_SymConst(write_env_t *env, const ir_node *node) ...@@ -938,11 +938,11 @@ static void write_SymConst(write_env_t *env, const ir_node *node)
write_entity_ref(env, get_SymConst_entity(node)); write_entity_ref(env, get_SymConst_entity(node));
} }
typedef void (*write_node_func)(write_env_t *env, const ir_node *node); typedef void write_node_func(write_env_t *env, ir_node const *node);
static void register_node_writer(ir_op *op, write_node_func func) static void register_node_writer(ir_op *op, write_node_func *func)
{ {
set_generic_function_ptr(op, (op_func)func); set_generic_function_ptr(op, func);
} }
static void writers_init(void) static void writers_init(void)
...@@ -958,8 +958,8 @@ static void writers_init(void) ...@@ -958,8 +958,8 @@ static void writers_init(void)
static void write_node(const ir_node *node, write_env_t *env) static void write_node(const ir_node *node, write_env_t *env)
{ {
ir_op *op = get_irn_op(node); ir_op *const op = get_irn_op(node);
write_node_func func = (write_node_func) get_generic_function_ptr(op); write_node_func *const func = get_generic_function_ptr(write_node_func, op);
fputc('\t', env->file); fputc('\t', env->file);
if (func == NULL) if (func == NULL)
......
...@@ -41,6 +41,9 @@ ...@@ -41,6 +41,9 @@
#define set_op_attr(op, attr) set_op_attr_((op), (attr)) #define set_op_attr(op, attr) set_op_attr_((op), (attr))
#define get_op_attr(op) get_op_attr_(op) #define get_op_attr(op) get_op_attr_(op)
#define set_generic_function_ptr(op, func) set_generic_function_ptr_((op), (op_func)(func))
#define get_generic_function_ptr(type, op) ((type*)get_generic_function_ptr_((op)))
/** /**
* Frees a newly created ir operation. * Frees a newly created ir operation.
*/ */
......
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