#include "irdump.h"
#include "irop_t.h"
#include "irprog_t.h"
+#include "iredges_t.h"
#include "irhooks.h"
res->in = NEW_ARR_D (ir_node *, irg->obst, (arity+1));
memcpy (&res->in[1], in, sizeof (ir_node *) * arity);
}
+
res->in[0] = block;
set_irn_dbg_info(res, db);
res->out = NULL;
res->node_nr = get_irp_new_node_nr();
#endif
- hook_new_node(res);
+#ifdef FIRM_EDGES_INPLACE
+ {
+ int i, n;
+ int not_a_block = !is_Block(res);
+
+ INIT_LIST_HEAD(&res->edge_info.outs_head);
+
+ for(i = 0, n = arity + not_a_block; i < n; ++i)
+ edges_notify_edge(res, i - not_a_block, res->in[i], NULL, irg);
+ }
+#endif
+
+ hook_new_node(irg, res);
return res;
}
void
set_irn_n (ir_node *node, int n, ir_node *in) {
- assert(node && node->kind == k_ir_node && -1 <= n && n < get_irn_arity(node));
+ assert(node && node->kind == k_ir_node);
+ assert(-1 <= n);
+ assert(n < get_irn_arity(node));
assert(in && in->kind == k_ir_node);
if ((n == -1) && (get_irn_opcode(node) == iro_Filter)) {
}
/* else fall through */
}
+
+ /* Call the hook */
+ hook_set_irn_n(node, n, in, node->in[n + 1]);
+
+#ifdef FIRM_EDGES_INPLACE
+ /* Here, we rely on src and tgt being in the current ir graph */
+ edges_notify_edge(node, n, in, node->in[n + 1], current_ir_graph);
+#endif
+
node->in[n + 1] = in;
}
return node->attr.a;
}
-type *
+free_attr
get_irn_free_attr (ir_node *node)
{
assert (node->op == op_Free);
- return node->attr.f = skip_tid(node->attr.f);
+ return node->attr.f;
}
symconst_attr
set_irn_n(node, 1, exo_ptr);
}
-tarval *get_Const_tarval (ir_node *node) {
- assert (node->op == op_Const);
- return node->attr.con.tv;
+tarval *(get_Const_tarval)(ir_node *node) {
+ return _get_Const_tarval(node);
}
void
node->attr.con.tv = con;
}
+cnst_classify_t (classify_Const)(ir_node *node)
+{
+ return _classify_Const(node);
+}
+
/* The source language type. Must be an atomic type. Mode of type must
be mode of node. For tarvals from entities type must be pointer to
type *
get_Free_type (ir_node *node) {
assert (node->op == op_Free);
- return node->attr.f = skip_tid(node->attr.f);
+ return node->attr.f.type = skip_tid(node->attr.f.type);
}
void
set_Free_type (ir_node *node, type *tp) {
assert (node->op == op_Free);
- node->attr.f = tp;
+ node->attr.f.type = tp;
+}
+
+where_alloc
+get_Free_where (ir_node *node) {
+ assert (node->op == op_Free);
+ return node->attr.f.where;
+}
+
+void
+set_Free_where (ir_node *node, where_alloc where) {
+ assert (node->op == op_Free);
+ node->attr.f.where = where;
}
ir_node **