[llvm-commits] CVS: reopt/lib/TraceToFunction/TraceToFunction.cpp

Brian Gaeke gaeke at cs.uiuc.edu
Thu May 20 14:36:12 PDT 2004


Changes in directory reopt/lib/TraceToFunction:

TraceToFunction.cpp updated: 1.48 -> 1.49

---
Log message:

Eliminate a dyn_cast. Rename fixupPhisAndCalls to fixupPhis, because it no
longer needs to deal with calls. 


---
Diffs of the changes:  (+5 -6)

Index: reopt/lib/TraceToFunction/TraceToFunction.cpp
diff -u reopt/lib/TraceToFunction/TraceToFunction.cpp:1.48 reopt/lib/TraceToFunction/TraceToFunction.cpp:1.49
--- reopt/lib/TraceToFunction/TraceToFunction.cpp:1.48	Thu May 20 13:22:48 2004
+++ reopt/lib/TraceToFunction/TraceToFunction.cpp	Thu May 20 14:34:26 2004
@@ -316,7 +316,7 @@
   return false;
 }
 
-static void fixupPhisAndCalls (BasicBlock *dstB, ValueMap &O2CMap) {
+static void fixupPhis (BasicBlock *dstB, ValueMap &O2CMap) {
   std::vector<Instruction *> goners;
   Function *F = dstB->getParent ();
   // Fix up Phi nodes:
@@ -366,13 +366,12 @@
 	  }
 	} while (lastOffTraceSrcFound != -1); // Continue until none found.
       }
-    }
     // Make sure that our Phi fixups did the Right Thing.
-    DEBUG(if (PHINode *PN = dyn_cast<PHINode> (&I))
-	  if (PN->use_size () != 0) // 0-use nodes get deleted later
+    DEBUG(if (PN->use_size () != 0) // 0-use nodes get deleted later
 	  for (unsigned i = 0; i < PN->getNumIncomingValues (); ++i)
 	  assert (PN->getIncomingBlock (i)->getParent () == F &&
-		  "Sorry, fixupPhisAndCalls mishandled a Phi node"));
+		  "Sorry, fixupPhis mishandled a Phi node"));
+    }
   }
 
   while (!goners.empty ()) {
@@ -419,7 +418,7 @@
     fixupFunctionBodyBB (T, F, srcB, dstB, O2CMap, So);
   }
   for (Function::iterator FI = F->begin (), FE = F->end (); FI != FE; ++FI)
-    fixupPhisAndCalls (FI, O2CMap);
+    fixupPhis (FI, O2CMap);
 }
 
 /// identifyFLIEdge - returns a true value iff BB is a basic block containing





More information about the llvm-commits mailing list