From fe131120d5f0063d84b46b64fdb89b5ef20cbf38 Mon Sep 17 00:00:00 2001 From: Matthias Braun Date: Tue, 23 Sep 2008 11:12:53 +0000 Subject: [PATCH] work around callgraph/cgana problems [r22189] --- ir/ana/callgraph.c | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/ir/ana/callgraph.c b/ir/ana/callgraph.c index b03a0f000..b9102dec4 100644 --- a/ir/ana/callgraph.c +++ b/ir/ana/callgraph.c @@ -388,7 +388,7 @@ static void do_walk(ir_graph *irg, callgraph_walk_func *pre, callgraph_walk_func void callgraph_walk(ir_entity **roots, unsigned n_roots, callgraph_walk_func *pre, callgraph_walk_func *post, void *env) { - //int i, n_irgs = get_irp_n_irgs(); + int i, n_irgs = get_irp_n_irgs(); unsigned r; ++master_cg_visited; @@ -400,18 +400,15 @@ void callgraph_walk(ir_entity **roots, unsigned n_roots, do_walk(irg, pre, post, env); } -#if 0 - for (i = 0; i < n_irgs; i++) { - ir_graph *irg = get_irp_irg(i); - if (!cg_irg_visited(irg) && get_irg_n_callers(irg) == 0) - do_walk(irg, pre, post, env); - } + /* cgana "optimizes" the graph instead of just analysing it so the + * roots list isn't even correct anymore when passed to this method... + * so we hack around this and search for more unreferenced/free + * methods... */ for (i = 0; i < n_irgs; i++) { ir_graph *irg = get_irp_irg(i); if (!cg_irg_visited(irg)) do_walk(irg, pre, post, env); } -#endif } /* ----------------------------------------------------------------------------------- */ -- 2.20.1