As much as I dislike doing this, it's the only fix for VC8.0 that I can come
authorChris Lattner <sabre@nondot.org>
Sat, 5 Jun 2004 00:11:27 +0000 (00:11 +0000)
committerChris Lattner <sabre@nondot.org>
Sat, 5 Jun 2004 00:11:27 +0000 (00:11 +0000)
up with, even though it's perfectly conformant code.  :(

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14034 91177308-0d34-0410-b5e6-96231b3b80d8

lib/VMCore/BasicBlock.cpp

index dd529f8ee326807b9d78a5c66b5163b44e4e3219..d018cd292f620a8e95f9024ebe12338b27737823 100644 (file)
@@ -181,7 +181,8 @@ void BasicBlock::removePredecessor(BasicBlock *Pred) {
   } else {
     // Okay, now we know that we need to remove predecessor #pred_idx from all
     // PHI nodes.  Iterate over each PHI node fixing them up
-    for (iterator II = begin(); PHINode *PN = dyn_cast<PHINode>(II); ++II)
+    PHINode *PN;
+    for (iterator II = begin(); PN = dyn_cast<PHINode>(II); ++II)
       PN->removeIncomingValue(Pred);
   }
 }
@@ -221,8 +222,9 @@ BasicBlock *BasicBlock::splitBasicBlock(iterator I, const std::string &BBName) {
     // Loop over any phi nodes in the basic block, updating the BB field of
     // incoming values...
     BasicBlock *Successor = *I;
+    PHINode *PN;
     for (BasicBlock::iterator II = Successor->begin();
-         PHINode *PN = dyn_cast<PHINode>(II); ++II) {
+         PN = dyn_cast<PHINode>(II); ++II) {
       int IDX = PN->getBasicBlockIndex(this);
       while (IDX != -1) {
         PN->setIncomingBlock((unsigned)IDX, New);