Commit e109f4dc authored by Michael Beck's avatar Michael Beck
Browse files

- no need to add two custom pointers: the tag is now simply a 32bit number, typically a FOURCC code

[r19748]
parent 2fa18a49
......@@ -584,7 +584,7 @@ foreach my $op (keys(%nodes)) {
$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");
......@@ -645,7 +645,7 @@ if (length($arch) >= 4) {
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) {
......@@ -659,7 +659,7 @@ int get_$arch\_opcode_last(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 */
......
......@@ -158,11 +158,11 @@ static INLINE const ir_op_ops *_get_op_ops(const ir_op *op) {
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;
}
......
......@@ -56,7 +56,7 @@ struct ir_op {
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. */
......
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