*/
ir_node **get_irn_in(const ir_node *node);
-/**
- * The amount of additional space for custom data to be allocated upon creating a new node.
- */
-extern unsigned firm_add_node_size;
-
-/**
- * Sets the get_type_attr operation for an ir_op_ops.
- *
- * @param code the opcode for the default operation
- * @param ops the operations initialized
- *
- * @return
- * The operations.
- */
-void firm_set_default_get_type_attr(unsigned code, ir_op_ops *ops);
-
-/**
- * Sets the get_entity_attr operation for an ir_op_ops.
- *
- * @param code the opcode for the default operation
- * @param ops the operations initialized
- *
- * @return
- * The operations.
- */
-void firm_set_default_get_entity_attr(unsigned code, ir_op_ops *ops);
-
/**
* Returns an array with the predecessors of the Block. Depending on
* the implementation of the graph data structure this can be a copy of
assert(-1 <= n && n < get_irn_arity_(node));
nn = node->in[n + 1];
- if (nn->op != op_Id) return nn;
+ if (!is_Id(nn)) return nn;
return (node->in[n + 1] = skip_Id(nn));
}
/* forward declaration outside iredges_t.h to avoid circular include problems */
void edges_notify_edge_kind(ir_node *src, int pos, ir_node *tgt, ir_node *old_tgt, ir_edge_kind_t kind, ir_graph *irg);
-static inline void set_irn_dep_(ir_node *node, int pos, ir_node *dep)
-{
- ir_node *old;
-
- assert(node->deps && "dependency array node yet allocated. use add_irn_dep()");
- assert(pos >= 0 && pos < (int)ARR_LEN(node->deps) && "dependency index out of range");
- old = node->deps[pos];
- node->deps[pos] = dep;
- edges_notify_edge_kind(node, pos, dep, old, EDGE_KIND_DEP, get_irn_irg(node));
-}
-
-
static inline int get_irn_ins_or_deps_(const ir_node *irn)
{
return get_irn_deps_(irn) + get_irn_arity_(irn);
static inline ir_graph *get_irn_irg_(const ir_node *node)
{
- /*
- * Do not use get_nodes_block() here, because this
- * will check the pinned state.
- * However even a 'wrong' block is always in the proper irg.
- */
if (! is_Block(node))
- node = get_irn_n(node, -1);
+ node = get_nodes_block(node);
assert(ir_has_irg_ref(node));
return node->attr.irg.irg;
}
return (node->op->opar == oparity_binary);
}
-static inline int is_strictConv_(const ir_node *node)
-{
- return is_Conv_(node) && get_Conv_strict(node);
-}
-
static inline int is_SymConst_addr_ent_(const ir_node *node)
{
return is_SymConst(node) && get_SymConst_kind(node) == symconst_addr_ent;
static inline ir_tarval *get_Const_tarval_(const ir_node *node)
{
- assert(get_irn_op_(node) == op_Const);
+ assert(is_Const(node));
return node->attr.con.tarval;
}
return is_op_constlike(get_irn_op_(node));
}
-static inline int is_irn_always_opt_(const ir_node *node)
-{
- return is_op_always_opt(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_(const ir_node *node)
{
- assert(get_irn_op_(node) == op_Cond);
+ assert(is_Cond(node));
return node->attr.cond.jmp_pred;
}
static inline void set_Cond_jmp_pred_(ir_node *node, cond_jmp_predicate pred)
{
- assert(get_irn_op_(node) == op_Cond);
+ assert(is_Cond(node));
node->attr.cond.jmp_pred = pred;
}
return &table->entries[entry];
}
-/** initialize ir_node module */
-void init_irnode(void);
+void ir_register_getter_ops(void);
+
+/**
+ * because firm keepalive edges are a broken concept, we have to make sure that
+ * nodes which are only held by a keepalive edges are never moved again.
+ * This function returns true in this case.
+ */
+bool only_used_by_keepalive(const ir_node *node);
/* this section MUST contain all inline functions */
#define is_ir_node(thing) is_ir_node_(thing)
#define is_binop(node) is_binop_(node)
#define is_Proj(node) is_Proj_(node)
#define is_Phi(node) is_Phi_(node)
-#define is_strictConv(node) is_strictConv_(node)
#define is_SymConst_addr_ent(node) is_SymConst_addr_ent_(node)
#define get_Block_n_cfgpreds(node) get_Block_n_cfgpreds_(node)
#define get_Block_cfgpred(node, pos) get_Block_cfgpred_(node, pos)
#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_always_opt(node) is_irn_always_opt_(node)
#define is_irn_keep(node) is_irn_keep_(node)
#define is_irn_start_block_placed(node) is_irn_start_block_placed_(node)
#define is_irn_cse_neutral(node) is_irn_cse_neutral_(node)
#define get_irn_idx(node) get_irn_idx_(node)
#define get_irn_deps(node) get_irn_deps_(node)
-#define set_irn_dep(node, pos, dep) set_irn_dep_(node, pos, dep)
#define get_irn_dep(node, pos) get_irn_dep_(node, pos)
#define get_irn_ins_or_deps(node) get_irn_ins_or_deps_(node)