more LRH debugging junk
[fw/sdcc] / src / SDCCcflow.c
index aff9a856b1ac0778bdcd49cefd3269a1b7638aee..2da48baa65430991aebd56a1ed34b4d16e0d74a4 100644 (file)
@@ -1,3 +1,9 @@
+//#define LIVERANGEHUNT
+#ifdef LIVERANGEHUNT
+  #define LRH(x) x
+#else
+  #define LRH(x)
+#endif
 /*-------------------------------------------------------------------------
 
   SDCCcflow.c - source file for control flow analysis
@@ -131,6 +137,18 @@ eBBSuccessors (eBBlock ** ebbs, int count)
 
                  addSuccessor (ebbs[i], ebbs[j]);      /* add it */
                }
+             else
+               {
+                 int j=i;
+                 while (j--) {
+                   if (ebbs[j]->ech && ebbs[j]->ech->op==IFX &&
+                       (isSymbolEqual(IC_TRUE(ebbs[j]->ech), ebbs[i]->entryLabel) ||
+                        isSymbolEqual(IC_FALSE(ebbs[j]->ech), ebbs[i]->entryLabel))) {
+                     LRH(printf ("%s has a conditional exit from %s\n", ebbs[i]->entryLabel->name, ebbs[j]->entryLabel->name));
+                     ebbs[i]->hasConditionalExit=1;
+                   }
+                 }
+               }
            }                   /* no instructions in the block */
          /* could happen for dummy blocks */
          else