* @author Christian Schaefer, Goetz Lindenmaier, Michael Beck
* @version $Id$
*/
-#ifdef HAVE_CONFIG_H
-# include "config.h"
-#endif
+#include "config.h"
-#ifdef HAVE_STRING_H
-# include <string.h>
-#endif
+#include <string.h>
#include "irop_t.h"
#include "irnode_t.h"
#include "xmalloc.h"
+void be_init_op(void);
+
/** the available next opcode */
static unsigned next_iro = iro_MaxOpcode;
ir_op *op_SymConst; ir_op *get_op_SymConst (void) { return op_SymConst; }
ir_op *op_Call; ir_op *get_op_Call (void) { return op_Call; }
+ir_op *op_Builtin; ir_op *get_op_Builtin (void) { return op_Builtin; }
ir_op *op_Add; ir_op *get_op_Add (void) { return op_Add; }
ir_op *op_Sub; ir_op *get_op_Sub (void) { return op_Sub; }
ir_op *op_Minus; ir_op *get_op_Minus (void) { return op_Minus; }
ir_op *op_Pin; ir_op *get_op_Pin (void) { return op_Pin; }
ir_op *op_ASM; ir_op *get_op_ASM (void) { return op_ASM; }
+ir_op *op_Dummy; ir_op *get_op_Dummy (void) { return op_Dummy; }
ir_op *op_Anchor; ir_op *get_op_Anchor (void) { return op_Anchor; }
/*
unsigned flags, op_arity opar, int op_index, size_t attr_size,
const ir_op_ops *ops)
{
- ir_op *res;
-
- res = (ir_op *)xmalloc(sizeof(*res));
- memset(res, 0, sizeof(*res));
+ ir_op *res = XMALLOCZ(ir_op);
res->code = code;
res->name = new_id_from_chars(name, strlen(name));
op_Pin = new_ir_op(iro_Pin, "Pin", op_pin_state_pinned, H, oparity_unary, -1, 0, NULL);
op_ASM = new_ir_op(iro_ASM, "ASM", op_pin_state_mem_pinned, K|M, oparity_variable, -1, sizeof(asm_attr), NULL);
+ op_Builtin = new_ir_op(iro_Builtin, "Builtin", op_pin_state_mem_pinned, M, oparity_variable, -1, sizeof(builtin_attr), NULL);
+
+ op_Dummy = new_ir_op(iro_Dummy, "Dummy", op_pin_state_pinned, X|F|S|c|NB,oparity_zero, -1, 0, NULL);
op_Anchor = new_ir_op(iro_Anchor, "Anchor", op_pin_state_pinned, N|NB, oparity_variable, -1, 0, NULL);
#undef E
#undef NB
#undef NI
+
+ /* initialize backend opcodes */
+ be_init_op();
} /* init_op */
free_ir_op (op_Pin ); op_Pin = NULL;
free_ir_op (op_ASM ); op_ASM = NULL;
+ free_ir_op (op_Dummy ); op_Dummy = NULL;
free_ir_op (op_Anchor ); op_Anchor = NULL;
}