*/
#ifdef HAVE_CONFIG_H
-# include <config.h>
+# include "config.h"
#endif
+#ifdef HAVE_STRING_H
# include <string.h>
+#endif
# include "irop_t.h"
# include "irnode_t.h"
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_FuncCall; ir_op *get_op_FuncCall (void) { return op_FuncCall; }
+ir_op *op_NoMem; ir_op *get_op_NoMem (void) { return op_NoMem; }
ir_op *
{
ir_op *res;
- res = (ir_op *) xmalloc (sizeof (ir_op));
+ res = (ir_op *)xmalloc(sizeof(*res));
+ memset(res, 0, sizeof(*res));
+
res->code = code;
res->name = new_id_from_chars(name, strlen(name));
res->op_pin_state_pinned = p;
op_Sel = new_ir_op(iro_Sel, "Sel", op_pin_state_floats, L, oparity_any, -1, sizeof(sel_attr));
op_InstOf = new_ir_op(iro_InstOf, "InstOf", op_pin_state_floats, L, oparity_any, -1, sizeof(sel_attr));
- op_Call = new_ir_op(iro_Call, "Call", op_pin_state_pinned, L|F, oparity_variable, -1, sizeof(call_attr));
+ op_Call = new_ir_op(iro_Call, "Call", op_pin_state_mem_pinned, L|F, oparity_variable, -1, sizeof(call_attr));
op_Add = new_ir_op(iro_Add, "Add", op_pin_state_floats, C, oparity_binary, 0, 0);
op_Minus = new_ir_op(iro_Minus, "Minus", op_pin_state_floats, 0, oparity_unary, 0, 0);
op_Sub = new_ir_op(iro_Sub, "Sub", op_pin_state_floats, L, oparity_binary, 0, 0);
op_EndReg = new_ir_op(iro_EndReg, "EndReg", op_pin_state_pinned, X|I, oparity_any, -1, sizeof(end_attr));
op_EndExcept = new_ir_op(iro_EndExcept, "EndExcept", op_pin_state_pinned, X|I, oparity_any, -1, sizeof(end_attr));
- op_FuncCall = new_ir_op(iro_FuncCall, "FuncCall", op_pin_state_floats, L, oparity_any, -1, sizeof(call_attr));
+ op_NoMem = new_ir_op(iro_NoMem, "NoMem", op_pin_state_pinned, 0, oparity_zero, -1, 0);
#undef Y
#undef F
free_ir_op (op_EndReg ); op_EndReg = NULL;
free_ir_op (op_EndExcept); op_EndExcept = NULL;
- free_ir_op (op_FuncCall ); op_FuncCall = NULL;
+ free_ir_op (op_NoMem ); op_NoMem = NULL;
}
/* Returns the string for the opcode. */
return __get_op_ident(op);
}
+const char *get_op_pin_state_name(op_pin_state s) {
+ switch(s) {
+#define XXX(s) case s: return #s
+ XXX(op_pin_state_floats);
+ XXX(op_pin_state_pinned);
+ XXX(op_pin_state_exc_pinned);
+ XXX(op_pin_state_mem_pinned);
+#undef XXX
+ }
+ return "<none>";
+}
+
op_pin_state (get_op_pinned)(const ir_op *op){
return __get_op_pinned(op);
}