/********************************************************************/
/* Remeber the new node in the old node by using a field all nodes have. */
-inline void
+INLINE void
set_new_node (ir_node *old, ir_node *new)
{
old->link = new;
}
/* Get this new node, before the old node is forgotton.*/
-inline ir_node *
+INLINE ir_node *
get_new_node (ir_node * n)
{
return n->link;
Remembering the arity is useful, as it saves a lot of pointer
accesses. This function is called for all Phi and Block nodes
in a Block. */
-inline int
+INLINE int
compute_new_arity(ir_node *b) {
int i, res;
int irg_v, block_v;
new_arity = get_irn_arity(n);
}
}
- nn = new_ir_node(current_ir_graph,
+ nn = new_ir_node(get_irn_dbg_info(n),
+ current_ir_graph,
block,
get_irn_op(n),
get_irn_mode(n),
Spare the Bad predecessors of Phi and Block nodes. */
void
copy_preds (ir_node *n, void *env) {
- ir_node *nn, *block, *on;
+ ir_node *nn, *block;
int i, j;
nn = get_new_node(n);
oe = get_irg_end(current_ir_graph);
/* copy the end node by hand, allocate dynamic in array! */
- ne = new_ir_node(current_ir_graph,
+ ne = new_ir_node(get_irn_dbg_info(oe),
+ current_ir_graph,
NULL,
op_End,
mode_X,
copy_preds(get_irg_bad(current_ir_graph), NULL);
}
set_irg_bad(current_ir_graph, get_new_node(get_irg_bad(current_ir_graph)));
+ if (get_irn_link(get_irg_unknown(current_ir_graph)) == NULL) {
+ copy_node(get_irg_unknown(current_ir_graph), NULL);
+ copy_preds(get_irg_unknown(current_ir_graph), NULL);
+ }
+ set_irg_unknown(current_ir_graph, get_new_node(get_irg_unknown(current_ir_graph)));
}
/* Copies all reachable nodes to a new obstack. Removes bad inputs
ir_node **res_pred;
ir_node **cf_pred;
ir_node *ret, *phi;
- ir_node *cf_op, *bl;
+ ir_node *cf_op = NULL, *bl;
int arity, n_ret, n_exc, n_res, i, j, rem_opt;
- type *called_frame, *caller_frame;
+ type *called_frame;
if (!get_optimize() || !get_opt_inline()) return;
/** Turn off optimizations, this can cause problems when allocating new nodes. **/
/** Check preconditions **/
assert(get_irn_op(call) == op_Call);
- assert(get_Call_type(call) == get_entity_type(get_irg_ent(called_graph)));
+ /* assert(get_Call_type(call) == get_entity_type(get_irg_ent(called_graph))); */
assert(get_type_tpop(get_Call_type(call)) == type_method);
if (called_graph == current_ir_graph) return;
/* Initialize for compaction of in arrays */
inc_irg_block_visited(current_ir_graph);
- /*
- set_Block_block_visited(get_irg_start_block(called_graph),
- get_irg_block_visited(current_ir_graph) +1 +1); /* count for self edge */
/*** Replicate local entities of the called_graph ***/
/* copy the entities. */
called_frame = get_irg_frame_type(called_graph);
- for (i = 0; i < get_class_n_member(called_frame); i++) {
+ for (i = 0; i < get_class_n_members(called_frame); i++) {
entity *new_ent, *old_ent;
old_ent = get_class_member(called_frame, i);
new_ent = copy_entity_own(old_ent, get_cur_frame_type());
end_bl = get_new_node(get_irg_end_block(called_graph));
end = get_new_node(get_irg_end(called_graph));
arity = get_irn_arity(end_bl); /* arity = n_exc + n_ret */
- n_res = get_method_n_res(get_Call_type(call));
+ n_res = get_method_n_ress(get_Call_type(call));
res_pred = (ir_node **) malloc (n_res * sizeof (ir_node *));
cf_pred = (ir_node **) malloc (arity * sizeof (ir_node *));
Start, Call and end at pinned nodes as Store, Call. Place_early
places all floating nodes reachable from its argument through floating
nodes and adds all beginnings at pinned nodes to the worklist. */
-inline void place_early () {
- int i;
- bool del_me;
-
+INLINE void place_early () {
assert(worklist);
inc_irg_visited(current_ir_graph);
static ir_node *
consumer_dom_dca (ir_node *dca, ir_node *consumer, ir_node *producer)
{
- ir_node *block;
+ ir_node *block = NULL;
/* Compute the latest block into which we can place a node so that it is
before consumer. */
}
}
-inline void place_late() {
+INLINE void place_late() {
assert(worklist);
inc_irg_visited(current_ir_graph);
}
static void collect_nodes(ir_node *n, void *env) {
- int i;
if (is_no_Block(n)) {
ir_node *b = get_nodes_Block(n);
if (get_irg_dom_state(current_ir_graph) == dom_consistent)
set_irg_dom_inconsistent(current_ir_graph);
- //DDME(get_irg_ent(irg));
-
/* Use block visited flag to mark non-empty blocks. */
inc_irg_block_visited(irg);
irg_walk(end, merge_blocks, collect_nodes, NULL);
inc_irg_visited(current_ir_graph);
for(i = 0; i < get_End_n_keepalives(end); i++) {
ir_node *ka = get_End_keepalive(end, i);
- if (irn_not_visited(ka))
+ if (irn_not_visited(ka)) {
if ((get_irn_op(ka) == op_Block) && Block_not_block_visited(ka)) {
set_irg_block_visited(current_ir_graph, /* Don't walk all the way to Start. */
get_irg_block_visited(current_ir_graph)-1);
ARR_APP1 (ir_node *, in, ka);
}
}
+ }
/* DEL_ARR_F(end->in); GL @@@ tut nicht ! */
end->in = in;