/*
* Calculates the negated (Complement(R)) pnc condition.
*/
-int get_negated_pnc(int pnc, ir_mode *mode) {
+pn_Cmp get_negated_pnc(long pnc, ir_mode *mode) {
pnc ^= pn_Cmp_True;
/* do NOT add the Uo bit for non-floating point values */
if (! mode_is_float(mode))
pnc &= ~pn_Cmp_Uo;
- return pnc;
+ return (pn_Cmp) pnc;
}
/* Calculates the inversed (R^-1) pnc condition, i.e., "<" --> ">" */
-int
-get_inversed_pnc(int pnc) {
- int code = pnc & ~(pn_Cmp_Lt|pn_Cmp_Gt);
- int lesser = pnc & pn_Cmp_Lt;
- int greater = pnc & pn_Cmp_Gt;
+pn_Cmp get_inversed_pnc(long pnc) {
+ long code = pnc & ~(pn_Cmp_Lt|pn_Cmp_Gt);
+ long lesser = pnc & pn_Cmp_Lt;
+ long greater = pnc & pn_Cmp_Gt;
code |= (lesser ? pn_Cmp_Gt : 0) | (greater ? pn_Cmp_Lt : 0);
- return code;
+ return (pn_Cmp) code;
}
/**
}
ir_node *
-(get_Block_cfgpred)(ir_node *node, int pos) {
+(get_Block_cfgpred)(const ir_node *node, int pos) {
return _get_Block_cfgpred(node, pos);
}
}
ir_node *
-(get_Block_cfgpred_block)(ir_node *node, int pos) {
+(get_Block_cfgpred_block)(const ir_node *node, int pos) {
return _get_Block_cfgpred_block(node, pos);
}
int
-get_Block_matured(ir_node *node) {
+get_Block_matured(const ir_node *node) {
assert(node->op == op_Block);
return (int)node->attr.block.is_matured;
}
ir_type *
get_Const_type(ir_node *node) {
assert(node->op == op_Const);
+ node->attr.con.tp = skip_tid(node->attr.con.tp);
return node->attr.con.tp;
}
ir_node *
-get_Call_mem(ir_node *node) {
+get_Call_mem(const ir_node *node) {
assert(node->op == op_Call);
return get_irn_n(node, 0);
}
}
ir_node *
-get_Call_ptr(ir_node *node) {
+get_Call_ptr(const ir_node *node) {
assert(node->op == op_Call);
return get_irn_n(node, 1);
}
}
int
-get_Call_n_params(ir_node *node) {
+get_Call_n_params(const ir_node *node) {
assert(node->op == op_Call);
return (get_irn_arity(node) - CALL_PARAM_OFFSET);
}
int
-get_Call_arity(ir_node *node) {
+get_Call_arity(const ir_node *node) {
assert(node->op == op_Call);
return get_Call_n_params(node);
}
*/
ir_node *
-get_Call_param(ir_node *node, int pos) {
+get_Call_param(const ir_node *node, int pos) {
assert(node->op == op_Call);
return get_irn_n(node, pos + CALL_PARAM_OFFSET);
}
node->attr.call.cld_tp = tp;
}
-int Call_has_callees(ir_node *node) {
+int Call_has_callees(const ir_node *node) {
assert(node && node->op == op_Call);
return ((get_irg_callee_info_state(get_irn_irg(node)) != irg_callee_info_none) &&
(node->attr.call.callee_arr != NULL));
}
-int get_Call_n_callees(ir_node * node) {
+int get_Call_n_callees(const ir_node *node) {
assert(node && node->op == op_Call && node->attr.call.callee_arr);
return ARR_LEN(node->attr.call.callee_arr);
}
-ir_entity * get_Call_callee(ir_node * node, int pos) {
+ir_entity * get_Call_callee(const ir_node *node, int pos) {
assert(pos >= 0 && pos < get_Call_n_callees(node));
return node->attr.call.callee_arr[pos];
}
-void set_Call_callee_arr(ir_node * node, const int n, ir_entity ** arr) {
+void set_Call_callee_arr(ir_node *node, const int n, ir_entity ** arr) {
assert(node->op == op_Call);
if (node->attr.call.callee_arr == NULL || get_Call_n_callees(node) != n) {
node->attr.call.callee_arr = NEW_ARR_D(ir_entity *, current_ir_graph->obst, n);
memcpy(node->attr.call.callee_arr, arr, n * sizeof(ir_entity *));
}
-void remove_Call_callee_arr(ir_node * node) {
+void remove_Call_callee_arr(ir_node *node) {
assert(node->op == op_Call);
node->attr.call.callee_arr = NULL;
}
UNOP(Conv)
UNOP(Cast)
-int get_Conv_strict(ir_node *node) {
+int get_Conv_strict(const ir_node *node) {
assert(node->op == op_Conv);
return node->attr.conv.strict;
}
ir_type *
get_Cast_type(ir_node *node) {
assert(node->op == op_Cast);
+ node->attr.cast.totype = skip_tid(node->attr.cast.totype);
return node->attr.cast.totype;
}
int is_Cast_upcast(ir_node *node) {
ir_type *totype = get_Cast_type(node);
ir_type *fromtype = get_irn_typeinfo_type(get_Cast_op(node));
- ir_graph *myirg = get_irn_irg(node);
- assert(get_irg_typeinfo_state(myirg) == ir_typeinfo_consistent);
+ assert(get_irg_typeinfo_state(get_irn_irg(node)) == ir_typeinfo_consistent);
assert(fromtype);
while (is_Pointer_type(totype) && is_Pointer_type(fromtype)) {
node->attr.alloc.type = tp;
}
-where_alloc
+ir_where_alloc
get_Alloc_where(ir_node *node) {
assert(node->op == op_Alloc);
return node->attr.alloc.where;
}
void
-set_Alloc_where(ir_node *node, where_alloc where) {
+set_Alloc_where(ir_node *node, ir_where_alloc where) {
assert(node->op == op_Alloc);
node->attr.alloc.where = where;
}
node->attr.free.type = tp;
}
-where_alloc
+ir_where_alloc
get_Free_where(ir_node *node) {
assert(node->op == op_Free);
return node->attr.free.where;
}
void
-set_Free_where(ir_node *node, where_alloc where) {
+set_Free_where(ir_node *node, ir_where_alloc where) {
assert(node->op == op_Free);
node->attr.free.where = where;
}
/* Don't use get_irn_arity, get_irn_n in implementation as access
shall work independent of view!!! */
-void set_Filter_cg_pred_arr(ir_node * node, int arity, ir_node ** in) {
+void set_Filter_cg_pred_arr(ir_node *node, int arity, ir_node ** in) {
assert(node->op == op_Filter);
if (node->attr.filter.in_cg == NULL || arity != ARR_LEN(node->attr.filter.in_cg) - 1) {
+ ir_graph *irg = get_irn_irg(node);
node->attr.filter.in_cg = NEW_ARR_D(ir_node *, current_ir_graph->obst, arity + 1);
- node->attr.filter.backedge = NEW_ARR_D (int, current_ir_graph->obst, arity);
- memset(node->attr.filter.backedge, 0, sizeof(int) * arity);
+ node->attr.filter.backedge = new_backedge_arr(irg->obst, arity);
node->attr.filter.in_cg[0] = node->in[0];
}
memcpy(node->attr.filter.in_cg + 1, in, sizeof(ir_node *) * arity);
/* Psi support */
ir_node *get_Psi_cond(ir_node *node, int pos) {
- int num_conds = get_Psi_n_conds(node);
assert(node->op == op_Psi);
- assert(pos < num_conds);
+ assert(pos < get_Psi_n_conds(node));
return get_irn_n(node, 2 * pos);
}
void set_Psi_cond(ir_node *node, int pos, ir_node *cond) {
- int num_conds = get_Psi_n_conds(node);
assert(node->op == op_Psi);
- assert(pos < num_conds);
+ assert(pos < get_Psi_n_conds(node));
set_irn_n(node, 2 * pos, cond);
}
ir_node *get_Psi_val(ir_node *node, int pos) {
- int num_vals = get_Psi_n_conds(node);
assert(node->op == op_Psi);
- assert(pos < num_vals);
+ assert(pos < get_Psi_n_conds(node));
return get_irn_n(node, 2 * pos + 1);
}
void set_Psi_val(ir_node *node, int pos, ir_node *val) {
- int num_vals = get_Psi_n_conds(node);
assert(node->op == op_Psi);
- assert(pos < num_vals);
+ assert(pos < get_Psi_n_conds(node));
set_irn_n(node, 2 * pos + 1, val);
}
return _is_Conv(node);
}
+int
+(is_strictConv)(const ir_node *node) {
+ return _is_strictConv(node);
+}
+
int
(is_Cast)(const ir_node *node) {
return _is_Cast(node);
}
/* Returns true if the operation manipulates control flow. */
-int
-is_cfop(const ir_node *node) {
- return is_cfopcode(get_irn_op(node));
+int is_cfop(const ir_node *node) {
+ return is_op_cfopcode(get_irn_op(node));
}
/* Returns true if the operation manipulates interprocedural control flow:
case iro_Store :
case iro_Alloc :
case iro_Bound :
- return get_irn_n(node, 0);
+ case iro_CopyB :
+ return get_irn_n(node, pn_Generic_M_regular);
case iro_Bad :
case iro_Unknown:
return node;
}
#else /* DEBUG_libfirm */
-void dump_irn(ir_node *n) {}
+void dump_irn(ir_node *n) { (void) n; }
#endif /* DEBUG_libfirm */