Commit d8bf70db authored by Götz Lindenmaier's avatar Götz Lindenmaier
Browse files

Call_callees now with unknown_entity

ir_ir_loop()

[r4343]
parent 6bc091c2
......@@ -141,7 +141,7 @@ static void ana_Call(ir_node *n, void *env) {
n_callees = get_Call_n_callees(n);
for (i = 0; i < n_callees; ++i) {
entity *callee_e = get_Call_callee(n, i);
if (callee_e) { /* Null for unknown caller */
if (callee_e != unknown_entity) { /* For unknown caller */
ir_graph *callee = get_entity_irg(callee_e);
pset_insert((pset *)callee->callers, irg, (unsigned)irg >> 3);
......
......@@ -509,7 +509,7 @@ static void callee_walker(ir_node * call, void * env) {
entity ** arr = NEW_ARR_F(entity *, 0);
callee_ana_node(skip_Id(get_Call_ptr(call)), methods);
if (eset_contains(methods, MARK)) { /* unknown method */
ARR_APP1(entity *, arr, NULL);
ARR_APP1(entity *, arr, unknown_entity);
}
for (ent = eset_first(methods); ent; ent = eset_next(methods)) {
if (ent != MARK) {
......@@ -535,6 +535,13 @@ static void callee_walker(ir_node * call, void * env) {
} else
#endif
{
/* remove, what we repaired. */
int i;
for (i = 0; i < ARR_LEN(arr); ++i) {
assert(arr[i]);
//if (arr[i] == unknown_entity) arr[i] = NULL;
}
set_Call_callee_arr(call, ARR_LEN(arr), arr);
}
DEL_ARR_F(arr);
......
......@@ -76,6 +76,9 @@ typedef union {
ir_loop *son; /**< Pointer to an ir_loop element */
} loop_element;
int is_ir_loop(const void *thing);
/** Set the outermost loop in ir graph as basic access to loop tree. */
void set_irg_loop(ir_graph *irg, ir_loop *l);
ir_loop *get_irg_loop(ir_graph *irg);
......@@ -106,7 +109,8 @@ loop_element get_loop_element (ir_loop *loop, int pos);
int get_loop_element_pos(ir_loop *loop, void *le);
/** Returns a unique node number for the loop node to make output
readable. Casten pointer if libfirm_debug not set. */
readable. If libfirm_debug is not set it returns the loop cast to
int. */
int get_loop_loop_nr(ir_loop *loop);
/** A field to connect additional information to a loop. Only valid
......
......@@ -487,6 +487,10 @@ void *get_loop_link (const ir_loop *loop) {
#endif
}
int is_ir_loop(const void *thing) {
return (get_kind(thing) == k_ir_loop);
}
/* The outermost loop is remarked in the surrounding graph. */
void set_irg_loop(ir_graph *irg, ir_loop *loop) {
assert(irg);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment