- int i;
- int n_runs = 0;
- int rerun = TRUE;
-#ifdef INTERPROCEDURAL_VIEW
- int old_ip_view = get_interprocedural_view();
-
- set_interprocedural_view(0); /* save this for later */
-#endif
-
- /* init_tables has added main_irg to _live_graphs */
-
- /* Need to take care of graphs that are externally
- visible or sticky. Pretend that they are called: */
-
- for (i = 0; i < get_irp_n_irgs(); i++) {
- ir_graph *graph = get_irp_irg (i);
- ir_entity *ent = get_irg_entity (graph);
-
- if ((visibility_external_visible == get_entity_visibility (ent)) ||
- (stickyness_sticky == get_entity_stickyness (ent))) {
- eset_insert (_live_graphs, graph);
- // printf("external visible: "); DDMG(graph);
- }
- }
-
- while (rerun) {
- ir_graph *graph;
-
- /* start off new */
- eset *live_graphs = _live_graphs;
- _live_graphs = eset_create ();
-
- if (verbose > 1) {
- fprintf(stdout, "RTA: RUN %i\n", n_runs);
- }
-
- /* collect what we have found previously */
- eset_insert_all (_live_graphs, live_graphs);
-
- rerun = FALSE;
- for (graph = eset_first (live_graphs);
- graph;
- graph = eset_next (live_graphs)) {
-
- if (verbose > 1) {
- ir_fprintf(stdout, "RTA: RUN %i: considering graph of %+F\n", n_runs,
- graph);
- }
-
- rerun |= rta_fill_graph (graph);
- }
-
- eset_destroy (live_graphs);
-
- n_runs ++;
- }
+ int i;
+ int n_runs = 0;
+ bool rerun = true;
+
+ /* init_tables has added main_irg to _live_graphs */
+
+ /* Need to take care of graphs that are externally
+ visible or sticky. Pretend that they are called: */
+ for (i = get_irp_n_irgs() - 1; i >= 0; --i) {
+ ir_graph *graph = get_irp_irg(i);
+ ir_entity *ent = get_irg_entity(graph);
+ ir_linkage linkage = get_entity_linkage(ent);
+
+ if (entity_is_externally_visible(ent)
+ || (linkage & IR_LINKAGE_HIDDEN_USER)) {
+ pset_new_insert(_live_graphs, graph);
+ }
+ }