diff options
author | Chris Lattner <sabre@nondot.org> | 2004-06-05 00:11:27 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2004-06-05 00:11:27 +0000 |
commit | 708ee9d965386cfbdd46d2b84824065f81ee0d3a (patch) | |
tree | 53b1b3a83b6fa785463bf648641982e149cff117 /llvm/lib/VMCore/BasicBlock.cpp | |
parent | 5c391ce004ac12252c08ad1f9586c8072a7e9ace (diff) | |
download | bcm5719-llvm-708ee9d965386cfbdd46d2b84824065f81ee0d3a.tar.gz bcm5719-llvm-708ee9d965386cfbdd46d2b84824065f81ee0d3a.zip |
As much as I dislike doing this, it's the only fix for VC8.0 that I can come
up with, even though it's perfectly conformant code. :(
llvm-svn: 14034
Diffstat (limited to 'llvm/lib/VMCore/BasicBlock.cpp')
-rw-r--r-- | llvm/lib/VMCore/BasicBlock.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/llvm/lib/VMCore/BasicBlock.cpp b/llvm/lib/VMCore/BasicBlock.cpp index dd529f8ee32..d018cd292f6 100644 --- a/llvm/lib/VMCore/BasicBlock.cpp +++ b/llvm/lib/VMCore/BasicBlock.cpp @@ -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); |