- int i;
- int old_ip_view = interprocedural_view;
- eset *live_graphs = NULL;
- eset *dead_graphs = NULL;
-
- interprocedural_view = 0; /* save this for later */
-
- if (rerun) {
- int n_graphs = get_irp_n_irgs ();
-
- /* force all graphs to be entered in either live_graphs or dead_graphs */
- for (i = 0; i < n_graphs; i ++) {
- rta_is_alive_graph (get_irp_irg (i));
- }
-
- /* remember existing infos for later */
- live_graphs = _live_graphs;
- dead_graphs = _dead_graphs;
-
- /* ensure that live_graphs and dead_graphs aren't deallocated by rta_cleanup */
- _live_graphs = NULL;
- _dead_graphs = NULL;
-
- rta_cleanup ();
- init_tables ();
- }
-
- /* Consider all graphs, possibly taking into account existing infos */
- for (i = 0; i < get_irp_n_irgs(); i++) {
- ir_graph *graph = get_irp_irg (i);
-
- /* Need to take care of graphs that are externally
- visible. Pretend that they are called: */
- entity *ent = get_irg_entity (graph);
- if (visibility_local != get_entity_visibility (ent)) {
- eset_insert (_called_methods, ent);
-
- if (get_entity_irg (ent)) {
- eset_insert (_live_graphs, get_entity_irg (ent));
- }
-
- eset_insert (_live_classes, get_entity_owner (ent));
- }
-
- /* now check the graph */
- if (rerun) {
- if (is_alive (graph, live_graphs, dead_graphs)) {
- rta_fill_graph (graph);
- } else {
- /* nothing (except debugging printf's :-) */
- }
- } else {
- rta_fill_graph (graph);
- }
- }
-
- if (rerun) {
- /* clean up the tables that we have retained */
- eset_destroy (live_graphs);
- eset_destroy (dead_graphs);
- }
-
- interprocedural_view = old_ip_view; /* cover up our traces */
-}