# include "array.h"
# include "irbackedge_t.h"
# include "irflag_t.h"
+# include "iredges_t.h"
#if USE_EXPLICIT_PHI_IN_STACK
/* A stack needed for the automatic Phi node construction in constructor
/*
* language dependant initialization variable
*/
-static default_initialize_local_variable_func_t *default_initialize_local_variable = NULL;
+static uninitialized_local_variable_func_t *default_initialize_local_variable = NULL;
/* -------------------------------------------- */
/* privat interfaces, for professional use only */
ir_node *
new_rd_Const (dbg_info* db, ir_graph *irg, ir_node *block, ir_mode *mode, tarval *con)
{
- type *tp = firm_unknown_type;
- /* removing this somehow causes errors in jack. */
- return new_rd_Const_type (db, irg, block, mode, con, tp);
+ return new_rd_Const_type (db, irg, block, mode, con, firm_unknown_type);
+}
+
+ir_node *
+new_rd_Const_long (dbg_info* db, ir_graph *irg, ir_node *block, ir_mode *mode, long value)
+{
+ return new_rd_Const(db, irg, block, mode, new_tarval_from_long(value, mode));
}
ir_node *
{
ir_node *res;
- assert(is_Atomic_type(to_tp));
+ assert(is_atomic_type(to_tp));
res = new_ir_node(db, irg, block, op_Cast, get_irn_mode(op), 1, &op);
res->attr.cast.totype = to_tp;
ir_node *
new_rd_Free (dbg_info* db, ir_graph *irg, ir_node *block, ir_node *store,
- ir_node *ptr, ir_node *size, type *free_type)
+ ir_node *ptr, ir_node *size, type *free_type, where_alloc where)
{
ir_node *in[3];
ir_node *res;
in[0] = store;
in[1] = ptr;
in[2] = size;
- res = new_ir_node (db, irg, block, op_Free, mode_T, 3, in);
- res->attr.f = free_type;
+ res = new_ir_node (db, irg, block, op_Free, mode_M, 3, in);
+ res->attr.f.where = where;
+ res->attr.f.type = free_type;
res = optimize_node(res);
IRN_VRFY_IRG(res, irg);
return res;
ir_mode *mode, tarval *con) {
return new_rd_Const(NULL, irg, block, mode, con);
}
+
+ir_node *new_r_Const_long(ir_graph *irg, ir_node *block,
+ ir_mode *mode, long value) {
+ return new_rd_Const_long(NULL, irg, block, mode, value);
+}
+
+
ir_node *new_r_SymConst (ir_graph *irg, ir_node *block,
symconst_symbol value, symconst_kind symkind) {
return new_rd_SymConst(NULL, irg, block, value, symkind);
return new_rd_Alloc(NULL, irg, block, store, size, alloc_type, where);
}
ir_node *new_r_Free (ir_graph *irg, ir_node *block, ir_node *store,
- ir_node *ptr, ir_node *size, type *free_type) {
- return new_rd_Free(NULL, irg, block, store, ptr, size, free_type);
+ ir_node *ptr, ir_node *size, type *free_type, where_alloc where) {
+ return new_rd_Free(NULL, irg, block, store, ptr, size, free_type, where);
}
ir_node *new_r_Sync (ir_graph *irg, ir_node *block, int arity, ir_node **in) {
return new_rd_Sync(NULL, irg, block, arity, in);
#if USE_EXPLICIT_PHI_IN_STACK
free_to_Phi_in_stack(res);
#else
+ edges_node_deleted(res, current_ir_graph);
obstack_free (current_ir_graph->obst, res);
#endif
res = known;
/* i==ins: there is at most one predecessor, we don't need a phi node. */
if (i == ins) {
if (res != known) {
+ edges_node_deleted(res, current_ir_graph);
obstack_free (current_ir_graph->obst, res);
if (is_Phi(known)) {
/* If pred is a phi node we want to optmize it: If loops are matured in a bad
before recuring.
*/
if (default_initialize_local_variable)
- block->attr.block.graph_arr[pos] = default_initialize_local_variable(mode, pos - 1);
+ block->attr.block.graph_arr[pos] = default_initialize_local_variable(current_ir_graph, mode, pos - 1);
else
block->attr.block.graph_arr[pos] = new_Const(mode, tarval_bad);
/* We don't need to care about exception ops in the start block.
}
ir_node *
+new_d_Const_long(dbg_info* db, ir_mode *mode, long value)
+{
+ return new_rd_Const_long(db, current_ir_graph, current_ir_graph->start_block, mode, value);
+}
+
+ ir_node *
new_d_Const_type (dbg_info* db, ir_mode *mode, tarval *con, type *tp)
{
return new_rd_Const_type(db, current_ir_graph, current_ir_graph->start_block,
}
ir_node *
-new_d_Free (dbg_info* db, ir_node *store, ir_node *ptr, ir_node *size, type *free_type)
+new_d_Free (dbg_info* db, ir_node *store, ir_node *ptr,
+ ir_node *size, type *free_type, where_alloc where)
{
return new_rd_Free (db, current_ir_graph, current_ir_graph->current_block,
- store, ptr, size, free_type);
+ store, ptr, size, free_type, where);
}
ir_node *
ir_node *
(new_d_Bad)(void)
{
- return __new_d_Bad();
+ return _new_d_Bad();
}
ir_node *
ir_node *
(new_d_NoMem)(void)
{
- return __new_d_NoMem();
+ return _new_d_NoMem();
}
ir_node *
/* call once for each run of the library */
void
-init_cons (default_initialize_local_variable_func_t *func)
+init_cons(uninitialized_local_variable_func_t *func)
{
default_initialize_local_variable = func;
}
return new_d_Const(NULL, mode, con);
}
+ir_node *new_Const_long(ir_mode *mode, long value)
+{
+ return new_d_Const_long(NULL, mode, value);
+}
+
ir_node *new_Const_type(tarval *con, type *tp) {
return new_d_Const_type(NULL, get_type_mode(tp), con, tp);
}
return new_d_Alloc(NULL, store, size, alloc_type, where);
}
ir_node *new_Free (ir_node *store, ir_node *ptr, ir_node *size,
- type *free_type) {
- return new_d_Free(NULL, store, ptr, size, free_type);
+ type *free_type, where_alloc where) {
+ return new_d_Free(NULL, store, ptr, size, free_type, where);
}
ir_node *new_Sync (int arity, ir_node **in) {
return new_d_Sync(NULL, arity, in);