Commit e5904ee6 authored by Christoph Mallon's avatar Christoph Mallon
Browse files

ir: Add and use is_irn_dynamic().

parent d2f630ad
......@@ -699,7 +699,7 @@ static void copy_attr(ir_graph *irg, const ir_node *old_node, ir_node *new_node)
if (old_info->in_reqs != NULL) {
unsigned n_ins = get_irn_arity(old_node);
/* need dynamic in infos? */
if (get_irn_op(old_node)->opar == oparity_dynamic) {
if (is_irn_dynamic(old_node)) {
new_info->in_reqs = NEW_ARR_F(const arch_register_req_t*, n_ins);
} else {
new_info->in_reqs = OALLOCN(obst,const arch_register_req_t*, n_ins);
......
......@@ -76,9 +76,8 @@ void exchange(ir_node *old, ir_node *nw)
}
}
if (get_irn_op(old)->opar == oparity_dynamic) {
if (is_irn_dynamic(old))
DEL_ARR_F(get_irn_in(old));
}
old->op = op_Id;
old->in = NEW_ARR_D(ir_node*, get_irg_obstack(irg), 2);
......
......@@ -209,7 +209,7 @@ int add_irn_n(ir_node *node, ir_node *in)
{
ir_graph *irg = get_irn_irg(node);
assert(node->op->opar == oparity_dynamic);
assert(is_irn_dynamic(node));
int pos = ARR_LEN(node->in) - 1;
ARR_APP1(ir_node *, node->in, in);
edges_notify_edge(node, pos, node->in[pos + 1], NULL, irg);
......
......@@ -323,6 +323,11 @@ static inline int is_binop_(const ir_node *node)
return (node->op->opar == oparity_binary);
}
static inline bool is_irn_dynamic(ir_node const *const n)
{
return get_irn_op(n)->opar == oparity_dynamic;
}
/**
* Get the predecessor block.
*
......
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