Added support for out edges.
[libfirm] / ir / ir / irop.c
index 2d11465..eba95cc 100644 (file)
@@ -20,7 +20,7 @@
 
 # include "irop_t.h"
 # include "irnode_t.h"
-# include "firmstat.h"
+# include "irhooks.h"
 
 # include "iropt_t.h"             /* for firm_set_default_operations */
 
@@ -88,6 +88,7 @@ ir_op *op_EndReg;      ir_op *get_op_EndReg    (void) { return op_EndReg;    }
 ir_op *op_EndExcept;   ir_op *get_op_EndExcept (void) { return op_EndExcept; }
 
 ir_op *op_NoMem;       ir_op *get_op_NoMem     (void) { return op_NoMem; }
+ir_op *op_Mux;         ir_op *get_op_Mux       (void) { return op_Mux; }
 
 
 /*
@@ -148,12 +149,12 @@ new_ir_op(opcode code, const char *name, op_pin_state p, unsigned flags, op_arit
   firm_set_default_operations(res);
   firm_set_default_copy_attr(res);
 
-  stat_new_ir_op(res);
+  hook_new_ir_op(res);
   return res;
 }
 
 void free_ir_op(ir_op *code) {
-  stat_free_ir_op(code);
+  hook_free_ir_op(code);
   free(code);
 }
 
@@ -209,7 +210,7 @@ init_op(void)
   op_Load      = new_ir_op(iro_Load,      "Load",      op_pin_state_exc_pinned, L|F, oparity_any,      -1, sizeof(load_attr));
   op_Store     = new_ir_op(iro_Store,     "Store",     op_pin_state_exc_pinned, L|F, oparity_any,      -1, sizeof(store_attr));
   op_Alloc     = new_ir_op(iro_Alloc,     "Alloc",     op_pin_state_pinned, L|F,     oparity_any,      -1, sizeof(alloc_attr));
-  op_Free      = new_ir_op(iro_Free,      "Free",      op_pin_state_pinned, L,       oparity_any,      -1, sizeof(type *));
+  op_Free      = new_ir_op(iro_Free,      "Free",      op_pin_state_pinned, L,       oparity_any,      -1, sizeof(free_attr));
   op_Sync      = new_ir_op(iro_Sync,      "Sync",      op_pin_state_pinned, 0,       oparity_any,      -1, 0);
 
   op_Proj      = new_ir_op(iro_Proj,      "Proj",      op_pin_state_floats, 0,       oparity_any,      -1, sizeof(long));
@@ -226,6 +227,7 @@ init_op(void)
   op_EndExcept = new_ir_op(iro_EndExcept, "EndExcept", op_pin_state_pinned, X|I,     oparity_any,      -1, sizeof(end_attr));
 
   op_NoMem     = new_ir_op(iro_NoMem,     "NoMem",     op_pin_state_pinned, 0,       oparity_zero,     -1, 0);
+  op_Mux       = new_ir_op(iro_Mux,       "Mux",       op_pin_state_floats, 0,       oparity_trinary,  -1, 0);
 
 #undef Y
 #undef F
@@ -297,6 +299,7 @@ void finish_op(void) {
   free_ir_op (op_EndExcept); op_EndExcept = NULL;
 
   free_ir_op (op_NoMem    ); op_NoMem     = NULL;
+  free_ir_op (op_Mux      ); op_Mux       = NULL;
 }
 
 /* Returns the string for the opcode. */
@@ -308,7 +311,7 @@ opcode (get_op_code)(const ir_op *op){
   return __get_op_code(op);
 }
 
-ident *(get_op_ident)(ir_op *op){
+ident *(get_op_ident)(const ir_op *op){
   return __get_op_ident(op);
 }