- no need to add two custom pointers: the tag is now simply a 32bit number, typically...
authorMichael Beck <beck@ipd.info.uni-karlsruhe.de>
Sat, 24 May 2008 16:22:08 +0000 (16:22 +0000)
committerMichael Beck <beck@ipd.info.uni-karlsruhe.de>
Sat, 24 May 2008 16:22:08 +0000 (16:22 +0000)
[r19748]

ir/be/scripts/generate_new_opcodes.pl
ir/ir/irop_t.h
ir/ir/irtypes.h

index 2246f06..b691e79 100755 (executable)
@@ -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 */
index 8364fe6..f6a1c27 100644 (file)
@@ -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;
 }
 
index 9baed2a..52dd2a2 100644 (file)
@@ -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. */