projects
/
libfirm
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
add an get_irg_idx
[libfirm]
/
ir
/
ir
/
irnode.c
diff --git
a/ir/ir/irnode.c
b/ir/ir/irnode.c
index
104c8d5
..
e81e212
100644
(file)
--- a/
ir/ir/irnode.c
+++ b/
ir/ir/irnode.c
@@
-664,6
+664,13
@@
set_nodes_block(ir_node *node, ir_node *block) {
set_irn_n(node, -1, block);
}
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) {
/* 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) {
@@
-726,7
+733,7
@@
int
}
ir_node *
}
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);
}
return _get_Block_cfgpred(node, pos);
}
@@
-737,12
+744,12
@@
set_Block_cfgpred(ir_node *node, int pos, ir_node *pred) {
}
ir_node *
}
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
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;
}
assert(node->op == op_Block);
return (int)node->attr.block.is_matured;
}
@@
-791,6
+798,7
@@
set_Block_graph_arr (ir_node *node, int pos, ir_node *value) {
node->attr.block.graph_arr[pos+1] = value;
}
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) {
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) {
@@
-835,6
+843,7
@@
void remove_Block_cg_cfgpred_arr(ir_node *node) {
assert(node->op == op_Block);
node->attr.block.in_cg = NULL;
}
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_node *(set_Block_dead)(ir_node *block) {
return _set_Block_dead(block);
@@
-1111,6
+1120,7
@@
int (is_Const_all_one)(const ir_node *node) {
ir_type *
get_Const_type(ir_node *node) {
assert(node->op == op_Const);
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;
}
return node->attr.con.tp;
}
@@
-1494,7
+1504,7
@@
BINOP(Cmp)
UNOP(Conv)
UNOP(Cast)
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;
}
assert(node->op == op_Conv);
return node->attr.conv.strict;
}
@@
-1507,6
+1517,7
@@
void set_Conv_strict(ir_node *node, int strict_flag) {
ir_type *
get_Cast_type(ir_node *node) {
assert(node->op == op_Cast);
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;
}
return node->attr.cast.totype;
}
@@
-1524,9
+1535,8
@@
set_Cast_type(ir_node *node, ir_type *to_tp) {
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));
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)) {
assert(fromtype);
while (is_Pointer_type(totype) && is_Pointer_type(fromtype)) {
@@
-1613,19
+1623,9
@@
set_binop_right(ir_node *node, ir_node *right) {
set_irn_n(node, node->op->op_index + 1, right);
}
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) {
}
int is_Phi0(const ir_node *n) {
@@
-2205,30
+2205,26
@@
void set_Mux_true(ir_node *node, ir_node *ir_true) {
/* Psi support */
ir_node *get_Psi_cond(ir_node *node, int pos) {
/* 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(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) {
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(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) {
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(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) {
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(node->op == op_Psi);
- assert(pos <
num_vals
);
+ assert(pos <
get_Psi_n_conds(node)
);
set_irn_n(node, 2 * pos + 1, val);
}
set_irn_n(node, 2 * pos + 1, val);
}
@@
-2716,6
+2712,11
@@
int
return _is_Conv(node);
}
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_Cast)(const ir_node *node) {
return _is_Cast(node);
@@
-2839,7
+2840,7
@@
int
}
int
}
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);
assert(node);
return node->op == op_Proj ||
(!get_interprocedural_view() && node->op == op_Filter);
@@
-2878,7
+2879,8
@@
ir_node *get_fragile_op_mem(ir_node *node) {
case iro_Store :
case iro_Alloc :
case iro_Bound :
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;
case iro_Bad :
case iro_Unknown:
return node;
@@
-3095,5
+3097,5
@@
void dump_irn(ir_node *n) {
}
#else /* DEBUG_libfirm */
}
#else /* DEBUG_libfirm */
-void dump_irn(ir_node *n) {}
+void dump_irn(ir_node *n) {
(void) n;
}
#endif /* DEBUG_libfirm */
#endif /* DEBUG_libfirm */