Commit more code over to new cast style


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@697 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Transforms/Scalar/DCE.cpp b/lib/Transforms/Scalar/DCE.cpp
index ba3db99..10dcf1e 100644
--- a/lib/Transforms/Scalar/DCE.cpp
+++ b/lib/Transforms/Scalar/DCE.cpp
@@ -84,7 +84,7 @@
     return false;   // More than one predecessor...
 
   Instruction *I = BB->front();
-  if (!I->isPHINode()) return false;  // No PHI nodes
+  if (!isa<PHINode>(I)) return false;  // No PHI nodes
 
   //cerr << "Killing PHIs from " << BB;
   //cerr << "Pred #0 = " << *BB->pred_begin();
@@ -92,7 +92,7 @@
   //cerr << "Method == " << BB->getParent();
 
   do {
-    PHINode *PN = (PHINode*)I;
+    PHINode *PN = cast<PHINode>(I);
     assert(PN->getNumOperands() == 2 && "PHI node should only have one value!");
     Value *V = PN->getOperand(0);
 
@@ -100,7 +100,7 @@
     delete BB->getInstList().remove(BB->begin());
 
     I = BB->front();
-  } while (I->isPHINode());
+  } while (isa<PHINode>(I));
 	
   return true;  // Yes, we nuked at least one phi node
 }
@@ -120,7 +120,7 @@
 // Assumption: BB is the single predecessor of Succ.
 //
 static void PropogatePredecessorsForPHIs(BasicBlock *BB, BasicBlock *Succ) {
-  assert(Succ->front()->isPHINode() && "Only works on PHId BBs!");
+  assert(isa<PHINode>(Succ->front()) && "Only works on PHId BBs!");
 
   // If there is more than one predecessor, and there are PHI nodes in
   // the successor, then we need to add incoming edges for the PHI nodes
@@ -129,7 +129,7 @@
 
   BasicBlock::iterator I = Succ->begin();
   do {                     // Loop over all of the PHI nodes in the successor BB
-    PHINode *PN = (PHINode*)*I;
+    PHINode *PN = cast<PHINode>(*I);
     Value *OldVal = PN->removeIncomingValue(BB);
     assert(OldVal && "No entry in PHI for Pred BB!");
 
@@ -140,7 +140,7 @@
     }
 
     ++I;
-  } while ((*I)->isPHINode());
+  } while (isa<PHINode>(*I));
 }
 
 
@@ -198,7 +198,7 @@
       //cerr << "Killing Trivial BB: \n" << BB;
       
       if (Succ != BB) {   // Arg, don't hurt infinite loops!
-	if (Succ->front()->isPHINode()) {
+	if (isa<PHINode>(Succ->front())) {
 	  // If our successor has PHI nodes, then we need to update them to
 	  // include entries for BB's predecessors, not for BB itself.
 	  //