$temp = "\top_$op = new_ir_op(cur_opcode + iro_$op, \"$op\", op_pin_state_".$n{"state"}.", ".$n{"op_flags"};
$temp .= "|M, ".translate_arity($arity).", 0, sizeof(${attr_type}), &ops);\n";
push(@obst_new_irop, $temp);
- push(@obst_new_irop, "\tset_op_tag(op_$op, &$arch\_op_tag);\n");
+ push(@obst_new_irop, "\tset_op_tag(op_$op, $arch\_op_tag);\n");
if(defined($default_op_attr_type)) {
push(@obst_new_irop, "\tattr = ($default_op_attr_type *) xmalloc(sizeof(attr[0]));\n");
push(@obst_new_irop, "\tmemset(attr, 0, sizeof(attr[0]));\n");
print OUT<<ENDOFISIRN;
/** A tag for the $arch opcodes. Note that the address is used as a tag value, NOT the FOURCC code. */
-static unsigned $arch\_op_tag = FOURCC('$a', '$b', '$c', '$d');
+#define $arch\_op_tag FOURCC('$a', '$b', '$c', '$d')
/** Return the opcode number of the first $arch opcode. */
int get_$arch\_opcode_first(void) {
/** Return 1 if the given opcode is a $arch machine op, 0 otherwise */
int is_$arch\_op(const ir_op *op) {
- return get_op_tag(op) == &$arch\_op_tag;
+ return get_op_tag(op) == $arch\_op_tag;
}
/** Return 1 if the given node is a $arch machine node, 0 otherwise */
return &op->ops;
}
-static INLINE void _set_op_tag(ir_op *op, void *tag) {
+static INLINE void _set_op_tag(ir_op *op, unsigned tag) {
op->tag = tag;
}
-static INLINE void *_get_op_tag(const ir_op *op) {
+static INLINE unsigned _get_op_tag(const ir_op *op) {
return op->tag;
}
op_arity opar; /**< The arity of operator. */
int op_index; /**< The index of the first data operand, 0 for most cases, 1 for Div etc. */
unsigned flags; /**< Flags describing the behavior of the ir_op, a bitmasks of irop_flags. */
- void *tag; /**< Some custom pointer the op's creator can attach stuff to. */
+ unsigned tag; /**< Some custom TAG value the op's creator set to. */
void *attr; /**< custom pointer where op's creator can attach attribute stuff to. */
ir_op_ops ops; /**< The operations of the this op. */