# New Ticket Created by  Matt Fowles 
# Please include the string:  [perl #24840]
# in the subject line of all future correspondence about this issue. 
# <URL: http://rt.perl.org/rt3/Ticket/Display.html?id=24840 >


All~

This patch simply removes some dead code from imcc/cfg.c

I killed the code about 6 months ago, and it does not look like it has 
been revived...

All test pass under make test, make testj, make testP, and make test_imcc

Matt
Index: imcc/cfg.c
===================================================================
RCS file: /cvs/public/parrot/imcc/cfg.c,v
retrieving revision 1.56
diff -u -r1.56 cfg.c
--- imcc/cfg.c  6 Dec 2003 15:24:43 -0000       1.56
+++ imcc/cfg.c  7 Jan 2004 23:35:56 -0000
@@ -676,15 +676,9 @@
 void
 compute_dominators (Parrot_Interp interpreter, IMC_Unit * unit)
 {
-#define USE_BFS 1
-
-#if !USE_BFS
-    int i, change, pred_index;
-#else
     int i, cur, len, succ_index;
     int *q;
     Set *visited;
-#endif
     int n;
     Edge *edge;
     Set** dominators;
@@ -700,7 +694,6 @@
         dominators[i] = set_make_full(n);
     }
 
-#if USE_BFS
     q = calloc(n, sizeof(int));
     visited = set_make (n);
     set_add(visited, 0);
@@ -721,39 +714,10 @@
         }
         cur++;
     }
-#else
-    change = 1;
-    while(change) {
-        change = 0;
-
-        /* TODO: This 'for' should be a breadth-first search for speed */
-        for (i = 1; i < n; i++) {
-            Set *s = set_copy (dominators[i]);
-
-            for (edge=unit->bb_list[i]->pred_list;
-                    edge; edge=edge->pred_next) {
-                pred_index = edge->from->index;
-                set_intersec_inplace(s, dominators[pred_index]);
-            }
-
-            set_add(s, i);
-
-            if (! set_equal(dominators[i], s) ) {
-                change = 1;
-                set_free (dominators[i]);
-                dominators[i] = s;
-            }
-            else
-                set_free(s);
-        }
-    }
-#endif
     if (interpreter->imc_info->debug & DEBUG_CFG)
         dump_dominators(unit);
-#if USE_BFS
     free(q);
     set_free(visited);
-#endif
 }
 
 static void

Reply via email to