Commit 5940087c authored by Michael Beck's avatar Michael Beck
Browse files

Fixed more size_t related warnings, one interface change.

cgana() returns now the lenght of the free_methods array instead of
setting a passed pointer.

[r28263]
parent 725a576d
......@@ -76,7 +76,7 @@
* - Replace (Sel-method(Alloc)) by SymConst-entity.
* - Replaces Sel-method by SymConst-entity if the method is never overwritten.
*/
FIRM_API void cgana(int *len, ir_entity ***free_methods);
FIRM_API size_t cgana(ir_entity ***free_methods);
/** Free callee information.
*
......
/*
* Copyright (C) 1995-2008 University of Karlsruhe. All right reserved.
* Copyright (C) 1995-2011 University of Karlsruhe. All right reserved.
*
* This file is part of libFirm.
*
......@@ -322,7 +322,7 @@ void compute_callgraph(void)
/* Change the sets to arrays. */
for (i = 0; i < n_irgs; ++i) {
int j, count;
size_t j, count;
cg_callee_entry *callee;
ir_graph *c, *irg = get_irp_irg(i);
pset *callee_set, *caller_set;
......
/*
* Copyright (C) 1995-2008 University of Karlsruhe. All right reserved.
* Copyright (C) 1995-2011 University of Karlsruhe. All right reserved.
*
* This file is part of libFirm.
*
......@@ -542,7 +542,7 @@ static void add_method_address(ir_entity *ent, eset *set)
* umgewandelt worden sein, d.h. SymConst-Operationen verweisen immer
* auf eine echt externe Methode.
*/
static ir_entity **get_free_methods(int *length)
static size_t get_free_methods(ir_entity ***free_methods)
{
eset *free_set = eset_create();
int i;
......@@ -550,6 +550,7 @@ static ir_entity **get_free_methods(int *length)
ir_entity *ent;
ir_graph *irg;
ir_type *tp;
size_t length;
for (i = get_irp_n_irgs() - 1; i >= 0; --i) {
ir_linkage linkage;
......@@ -587,14 +588,15 @@ static ir_entity **get_free_methods(int *length)
eset_insert(free_set, get_irg_entity(irg));
/* Finally, transform the set into an array. */
*length = eset_count(free_set);
arr = XMALLOCN(ir_entity*, *length);
length = eset_count(free_set);
arr = XMALLOCN(ir_entity*, length);
for (i = 0, ent = (ir_entity*) eset_first(free_set); ent; ent = (ir_entity*) eset_next(free_set)) {
arr[i++] = ent;
}
eset_destroy(free_set);
return arr;
*free_methods = arr;
return length;
}
/*--------------------------------------------------------------------------*/
......@@ -815,13 +817,15 @@ static void destruct_walker(ir_node * node, void * env)
/* Main drivers. */
/*--------------------------------------------------------------------------*/
void cgana(int *length, ir_entity ***free_methods)
size_t cgana(ir_entity ***free_methods)
{
size_t length;
/* Optimize Sel/SymConst nodes and compute all methods that implement an entity. */
sel_methods_init();
*free_methods = get_free_methods(length);
length = get_free_methods(free_methods);
callee_ana();
sel_methods_dispose();
return length;
}
void free_callee_info(ir_graph *irg)
......
/*
* Copyright (C) 1995-2008 University of Karlsruhe. All right reserved.
* Copyright (C) 1995-2011 University of Karlsruhe. All right reserved.
*
* This file is part of libFirm.
*
......@@ -365,7 +365,8 @@ static int count_outs(ir_graph *irg)
*/
static ir_def_use_edge *_set_out_edges(ir_node *use, ir_def_use_edge *free)
{
int n_outs, start, i, irn_arity, pos;
int start, i, irn_arity, pos;
size_t n_outs;
mark_irn_visited(use);
......@@ -413,7 +414,7 @@ static ir_def_use_edge *_set_out_edges(ir_node *use, ir_def_use_edge *free)
static ir_def_use_edge *set_out_edges(ir_graph *irg, ir_def_use_edge *free)
{
ir_node *n;
int i, n_outs;
int i;
inc_irg_visited(irg);
free = _set_out_edges(get_irg_end(irg), free);
......@@ -422,7 +423,7 @@ static ir_def_use_edge *set_out_edges(ir_graph *irg, ir_def_use_edge *free)
for (i = anchor_last - 1; i >= 0; --i) {
n = get_irg_anchor(irg, i);
if (!irn_visited_else_mark(n)) {
n_outs = PTR_TO_INT(n->out);
size_t n_outs = PTR_TO_INT(n->out);
n->out = free;
#ifdef DEBUG_libfirm
n->out_valid = 1;
......
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