/* Returns non-zero if the caller at position pos is "a backedge", i.e. a recursion. */
int is_irg_caller_backedge(ir_graph *irg, int pos) {
assert (pos >= 0 && pos < get_irg_n_callers(irg));
- return irg->caller_isbe != NULL ? irg->caller_isbe[pos] : 0;
+ return irg->caller_isbe != NULL ? rbitset_is_set(irg->caller_isbe, pos) : 0;
}
/** Search the caller in the list of all callers and set it's backedge property. */
/* allocate a new array on demand */
if (irg->caller_isbe == NULL)
- irg->caller_isbe = xcalloc(n_callers, sizeof(irg->caller_isbe[0]));
+ irg->caller_isbe = rbitset_malloc(n_callers);
for (i = 0; i < n_callers; ++i) {
if (get_irg_caller(irg, i) == caller) {
- irg->caller_isbe[i] = 1;
+ rbitset_set(irg->caller_isbe, i);
break;
}
}
if (irg->caller_isbe != NULL) {
for (i = 0; i < n_callers; ++i)
- if (irg->caller_isbe[i]) return 1;
+ if (rbitset_is_set(irg->caller_isbe, i))
+ return 1;
}
return 0;
}
the node. */
ir_graph **callers; /**< For callgraph analysis: list of caller graphs. */
- unsigned char *caller_isbe; /**< For callgraph analysis: set if backedge. */
+ unsigned *caller_isbe; /**< For callgraph analysis: raw bitset if backedge. */
cg_callee_entry **callees; /**< For callgraph analysis: list of callee calls */
unsigned char *callee_isbe; /**< For callgraph analysis: set if backedge. */
int callgraph_loop_depth; /**< For callgraph analysis */