return _is_irn_constlike(node);
}
+/*
+ * Returns non-zero for nodes that are allowed to have keep-alives and
+ * are neither Block nor PhiM.
+ */
+int (is_irn_keep)(const ir_node *node) {
+ return _is_irn_keep(node);
+}
+
/* Gets the string representation of the jump prediction .*/
const char *get_cond_jmp_predicate_name(cond_jmp_predicate pred)
{
_set_Cond_jmp_pred(cond, pred);
}
-/** the get_type/get_type_attr operation must be always implemented */
-static ir_type *get_Null_type(ir_node *n) {
- return NULL;
+/** the get_type operation must be always implemented and return a firm type */
+static ir_type *get_Default_type(ir_node *n) {
+ return get_unknown_type();
}
/* Sets the get_type operation for an ir_op_ops. */
default:
/* not allowed to be NULL */
if (! ops->get_type)
- ops->get_type = get_Null_type;
+ ops->get_type = get_Default_type;
break;
}
return ops;
return NULL;
}
+/** the get_type_attr operation must be always implemented */
+static ir_type *get_Null_type(ir_node *n) {
+ return firm_unknown_type;
+}
+
/* Sets the get_type operation for an ir_op_ops. */
ir_op_ops *firm_set_default_get_type_attr(opcode code, ir_op_ops *ops)
{
/** Return the type associated with the value produced by n
* if the node remarks this type as it is the case for
- * Cast, Const, SymConst and some Proj nodes. */
+ * Cast, Const, SymConst and some Proj nodes or unknown_type. */
ir_type *get_irn_type(ir_node *n);
/** Return the type attribute of a node n (SymConst, Call, Alloc, Free,
/** Returns non-zero for constant-like nodes. */
int is_irn_constlike(const ir_node *node);
+/**
+ * Returns non-zero for nodes that are allowed to have keep-alives and
+ * are neither Block nor PhiM.
+ */
+int is_irn_keep(const ir_node *node);
+
/**
* A type to express conditional jump predictions.
*/
return is_op_constlike(_get_irn_op(node));
}
+static INLINE int _is_irn_keep(const ir_node *node) {
+ return is_op_keep(_get_irn_op(node));
+}
+
static INLINE cond_jmp_predicate _get_Cond_jmp_pred(ir_node *node) {
assert (_get_irn_op(node) == op_Cond);
return node->attr.c.pred;
#define get_irn_type_attr(node) _get_irn_type_attr(node)
#define get_irn_entity_attr(node) _get_irn_entity_attr(node)
#define is_irn_constlike(node) _is_irn_constlike(node)
+#define is_irn_keep(node) _is_irn_keep(node)
#define get_Cond_jmp_pred(node) _get_Cond_jmp_pred(node)
#define set_Cond_jmp_pred(node, pred) _set_Cond_jmp_pred(node, pred)