/* Construct and destruct the callgraph. */
void compute_callgraph(void)
{
- int i, n_irgs;
+ size_t i, n_irgs;
/* initialize */
free_callgraph();
/* Destruct the callgraph. */
void free_callgraph(void)
{
- int i, n_irgs = get_irp_n_irgs();
+ size_t i, n_irgs = get_irp_n_irgs();
for (i = 0; i < n_irgs; ++i) {
ir_graph *irg = get_irp_irg(i);
if (irg->callees) DEL_ARR_F(irg->callees);
void callgraph_walk(callgraph_walk_func *pre, callgraph_walk_func *post, void *env)
{
- int i, n_irgs = get_irp_n_irgs();
+ size_t i, n_irgs = get_irp_n_irgs();
++master_cg_visited;
/* roots are methods which have no callers in the current program */
static void init_scc(struct obstack *obst)
{
- int i;
- int n_irgs;
+ size_t i, n_irgs;
current_dfn = 1;
loop_node_cnt = 0;
*/
static void reset_isbe(void)
{
- int i, n_irgs = get_irp_n_irgs();
+ size_t i, n_irgs = get_irp_n_irgs();
for (i = 0; i < n_irgs; ++i) {
ir_graph *irg = get_irp_irg(i);
/* For callees, we want to remember the Call nodes, too. */
typedef struct ana_entry2 {
ir_loop **loop_stack; /**< a stack of ir_loop entries */
- int tos; /**< the top of stack entry */
+ size_t tos; /**< the top of stack entry */
int recursion_nesting;
} ana_entry2;
*/
static int in_stack(ana_entry2 *e, ir_loop *g)
{
- int i;
- for (i = e->tos-1; i >= 0; --i) {
- if (e->loop_stack[i] == g) return 1;
+ size_t i;
+ for (i = e->tos; i != 0;) {
+ if (e->loop_stack[--i] == g) return 1;
}
return 0;
}
/* Compute the backedges that represent recursions. */
void find_callgraph_recursions(void)
{
- int i, n_irgs;
+ size_t i, n_irgs;
struct obstack temp;
reset_isbe();