# include "xmalloc.h"
+/** the available next opcode */
+static unsigned next_iro = iro_MaxOpcode;
+
ir_op *op_Block; ir_op *get_op_Block (void) { return op_Block; }
ir_op *op_Start; ir_op *get_op_Start (void) { return op_Start; }
if (op == op_Block || op == op_Phi || is_cfopcode(op)) return;
op->op_pin_state_pinned = op_pin_state_pinned;
}
+
+unsigned get_next_ir_opcode(void) {
+ return next_iro++;
+}
# include "ident.h"
-/** the opcodes */
+/** The opcodes of the libFirm predefined operations. */
typedef enum {
iro_Block,
iro_Start, iro_End, iro_Jmp, iro_Cond, iro_Return, iro_Raise,
for Block, Phi and control flow nodes. */
void set_op_pinned(ir_op *op, op_pin_state pinned);
+/** Returns the next free IR opcode number, allows to register user ops */
+unsigned get_next_ir_opcode(void);
+
# endif /* _IROP_H_ */
return n;
}
-/**
- * Returns the tarval of a Const node or tarval_bad for all other nodes.
- */
-static INLINE tarval *
-value_of (ir_node *n)
-{
- if ((n != NULL) && (get_irn_op(n) == op_Const))
- return get_Const_tarval(n); /* might return tarval_bad */
- else
- return tarval_bad;
-}
-
/**
* return the value of a Constant
*/
return 1;
/* for block-local cse and op_pin_state_pinned nodes: */
- if (!get_opt_global_cse() || (get_op_pinned(get_irn_op(a)) == op_pin_state_pinned)) {
+ if (!get_opt_global_cse() || (get_irn_pinned(a) == op_pin_state_pinned)) {
if (get_irn_n(a, -1) != get_irn_n(b, -1))
return 1;
}
/* Calculate a hash value of a node. */
unsigned ir_node_hash (ir_node *node);
+/**
+ * Returns the tarval of a Const node or tarval_bad for all other nodes.
+ */
+static INLINE tarval *
+value_of(ir_node *n) {
+ if ((n != NULL) && (get_irn_op(n) == op_Const))
+ return get_Const_tarval(n); /* might return tarval_bad */
+ else
+ return tarval_bad;
+}
+
# endif /* _IROPT_T_H_ */