}
ir_node *(get_irn_intra_n)(const ir_node *node, int n) {
- return _get_irn_intra_n (node, n);
+ return _get_irn_intra_n(node, n);
}
ir_node *(get_irn_inter_n)(const ir_node *node, int n) {
- return _get_irn_inter_n (node, n);
+ return _get_irn_inter_n(node, n);
}
ir_node *(*_get_irn_n)(const ir_node *node, int n) = _get_irn_intra_n;
assert(n < get_irn_arity(node));
assert(in && in->kind == k_ir_node);
+#ifdef INTERPROCEDURAL_VIEW
if ((n == -1) && (get_irn_opcode(node) == iro_Filter)) {
/* Change block pred in both views! */
node->in[n + 1] = in;
node->attr.filter.in_cg[n + 1] = in;
return;
}
-#ifdef INTERPROCEDURAL_VIEW
if (get_interprocedural_view()) { /* handle Filter and Block specially */
if (get_irn_opcode(node) == iro_Filter) {
assert(node->attr.filter.in_cg);
_set_irn_mode(node, mode);
}
-ir_modecode get_irn_modecode(const ir_node *node) {
- assert(node);
- return node->mode->code;
-}
-
/** Gets the string representation of the mode .*/
const char *get_irn_modename(const ir_node *node) {
assert(node);
return &node->attr.symc;
}
-ir_type *get_irn_call_attr(ir_node *node) {
+call_attr *get_irn_call_attr(ir_node *node) {
assert(is_Call(node));
- return node->attr.call.type = skip_tid(node->attr.call.type);
+ return &node->attr.call;
}
sel_attr *get_irn_sel_attr(ir_node *node) {
/* Sets the macro block header of a block. */
void set_Block_MacroBlock(ir_node *block, ir_node *mbh) {
assert(is_Block(block));
+ mbh = skip_Id(mbh);
assert(is_Block(mbh));
set_irn_n(block, -1, mbh);
}
}
/* returns the graph of a Block. */
-ir_graph *get_Block_irg(const ir_node *block) {
- assert(is_Block(block));
- return block->attr.block.irg;
+ir_graph *(get_Block_irg)(const ir_node *block) {
+ return _get_Block_irg(block);
}
ir_entity *create_Block_entity(ir_node *block) {
nr = get_irp_next_label_nr();
set_entity_label(entity, nr);
set_entity_compiler_generated(entity, 1);
+ set_entity_allocation(entity, allocation_static);
block->attr.block.entity = entity;
}
ir_type *
get_Const_type(ir_node *node) {
assert(is_Const(node));
- node->attr.con.tp = skip_tid(node->attr.con.tp);
return node->attr.con.tp;
}
ir_node *irn = (ir_node *)node;
assert(is_SymConst(node) &&
(SYMCONST_HAS_TYPE(get_SymConst_kind(node))));
- return irn->attr.symc.sym.type_p = skip_tid(irn->attr.symc.sym.type_p);
+ return irn->attr.symc.sym.type_p;
}
void
ir_type *
get_SymConst_value_type(ir_node *node) {
assert(is_SymConst(node));
- if (node->attr.symc.tp) node->attr.symc.tp = skip_tid(node->attr.symc.tp);
return node->attr.symc.tp;
}
ir_type *
get_Call_type(ir_node *node) {
assert(is_Call(node));
- return node->attr.call.type = skip_tid(node->attr.call.type);
+ return node->attr.call.type;
}
void
node->attr.call.type = tp;
}
+unsigned
+get_Call_tail_call(const ir_node *node) {
+ assert(is_Call(node));
+ return node->attr.call.tail_call;
+}
+
+void
+set_Call_tail_call(ir_node *node, unsigned tail_call) {
+ assert(is_Call(node));
+ node->attr.call.tail_call = tail_call != 0;
+}
+
ir_node *
get_Builtin_mem(const ir_node *node) {
assert(is_Builtin(node));
ir_type *
get_Builtin_type(ir_node *node) {
assert(is_Builtin(node));
- return node->attr.builtin.type = skip_tid(node->attr.builtin.type);
+ return node->attr.builtin.type;
}
void
ir_type *
get_Cast_type(ir_node *node) {
assert(is_Cast(node));
- node->attr.cast.type = skip_tid(node->attr.cast.type);
return node->attr.cast.type;
}
ir_type *
get_Alloc_type(ir_node *node) {
assert(is_Alloc(node));
- return node->attr.alloc.type = skip_tid(node->attr.alloc.type);
+ return node->attr.alloc.type;
}
void
ir_type *
get_Free_type(ir_node *node) {
assert(is_Free(node));
- return node->attr.free.type = skip_tid(node->attr.free.type);
+ return node->attr.free.type;
}
void
ir_type *get_CopyB_type(ir_node *node) {
assert(is_CopyB(node));
- return node->attr.copyb.type = skip_tid(node->attr.copyb.type);
+ return node->attr.copyb.type;
}
void set_CopyB_type(ir_node *node, ir_type *data_type) {
ir_type *
get_InstOf_type(ir_node *node) {
assert(node->op == op_InstOf);
- return node->attr.instof.type = skip_tid(node->attr.instof.type);
+ return node->attr.instof.type;
}
void
*/
if (! is_Block(node))
node = get_irn_n(node, -1);
- if (is_Bad(node)) /* sometimes bad is predecessor of nodes instead of block: in case of optimization */
- node = get_irn_n(node, -1);
- assert(is_Block(node));
- return node->attr.block.irg;
+ /* note that get_Block_irg() can handle Bad nodes */
+ return get_Block_irg(node);
}
case iro_Alloc :
case iro_Bound :
case iro_CopyB :
- return get_irn_n(node, pn_Generic_M_regular);
+ return get_irn_n(node, pn_Generic_M);
case iro_Bad :
case iro_Unknown:
return node;
return _is_irn_forking(node);
}
+void (copy_node_attr)(const ir_node *old_node, ir_node *new_node) {
+ _copy_node_attr(old_node, new_node);
+}
+
/* Return the type associated with the value produced by n
* if the node remarks this type as it is the case for
* Cast, Const, SymConst and some Proj nodes. */