set_irn_n(node, -1, block);
}
+/* this works for all except Block */
+ir_node *
+get_nodes_MacroBlock(const ir_node *node) {
+ assert(node->op != op_Block);
+ return get_Block_MacroBlock(get_irn_n(node, -1));
+}
+
/* Test whether arbitrary node is frame pointer, i.e. Proj(pn_Start_P_frame_base)
* from Start. If so returns frame type, else Null. */
ir_type *is_frame_pointer(ir_node *n) {
}
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;
}
node->attr.block.graph_arr[pos+1] = value;
}
+#ifdef INTERPROCEDURAL_VIEW
void set_Block_cg_cfgpred_arr(ir_node *node, int arity, ir_node *in[]) {
assert(node->op == op_Block);
if (node->attr.block.in_cg == NULL || arity != ARR_LEN(node->attr.block.in_cg) - 1) {
assert(node->op == op_Block);
node->attr.block.in_cg = NULL;
}
+#endif
ir_node *(set_Block_dead)(ir_node *block) {
return _set_Block_dead(block);
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;
}
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)) {
set_irn_n(node, node->op->op_index + 1, right);
}
-int is_Phi(const ir_node *n) {
- ir_op *op;
-
- assert(n);
- op = get_irn_op(n);
-
- if (op == op_Filter) return get_interprocedural_view();
-
- if (op == op_Phi)
- return ((get_irg_phase_state(get_irn_irg(n)) != phase_building) ||
- (get_irn_arity(n) > 0));
-
- return 0;
+int
+(is_Phi)(const ir_node *n) {
+ return _is_Phi(n);
}
int is_Phi0(const ir_node *n) {
/* 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);
}
int
-is_Proj(const ir_node *node) {
+(is_Proj)(const ir_node *node) {
assert(node);
return node->op == op_Proj ||
(!get_interprocedural_view() && node->op == op_Filter);
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 */