diff options
author | Alkis Evlogimenos <alkis@evlogimenos.com> | 2004-09-28 02:40:37 +0000 |
---|---|---|
committer | Alkis Evlogimenos <alkis@evlogimenos.com> | 2004-09-28 02:40:37 +0000 |
commit | 200a360ec66b4d016c17d6f8e3ea559b1fd07205 (patch) | |
tree | f6cdb933ddfa7a175c7b76465b58ed2138a96851 /lib/Transforms/Utils/LoopSimplify.cpp | |
parent | c4d3b918165461bc6f5d395bca8d9d9d8a84413d (diff) |
Pull assignment out of for loop conditional in order for this to
compile under windows. Patch contributed by Paolo Invernizzi!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@16534 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms/Utils/LoopSimplify.cpp')
-rw-r--r-- | lib/Transforms/Utils/LoopSimplify.cpp | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/lib/Transforms/Utils/LoopSimplify.cpp b/lib/Transforms/Utils/LoopSimplify.cpp index c576149170..aa3a86573a 100644 --- a/lib/Transforms/Utils/LoopSimplify.cpp +++ b/lib/Transforms/Utils/LoopSimplify.cpp @@ -213,8 +213,8 @@ BasicBlock *LoopSimplify::SplitBlockPredecessors(BasicBlock *BB, if (!Preds.empty()) { // Is the loop not obviously dead? // Check to see if the values being merged into the new block need PHI // nodes. If so, insert them. - for (BasicBlock::iterator I = BB->begin(); - PHINode *PN = dyn_cast<PHINode>(I); ) { + for (BasicBlock::iterator I = BB->begin(); isa<PHINode>(I); ) { + PHINode *PN = cast<PHINode>(I); ++I; // Check to see if all of the values coming in are the same. If so, we @@ -266,10 +266,11 @@ BasicBlock *LoopSimplify::SplitBlockPredecessors(BasicBlock *BB, } } else { // Otherwise the loop is dead... - for (BasicBlock::iterator I = BB->begin(); - PHINode *PN = dyn_cast<PHINode>(I); ++I) + for (BasicBlock::iterator I = BB->begin(); isa<PHINode>(I); ++I) { + PHINode *PN = cast<PHINode>(I); // Insert dummy values as the incoming value... PN->addIncoming(Constant::getNullValue(PN->getType()), NewBB); + } } return NewBB; } @@ -426,8 +427,8 @@ static void AddBlockAndPredsToSet(BasicBlock *BB, BasicBlock *StopBlock, /// FindPHIToPartitionLoops - The first part of loop-nestification is to find a /// PHI node that tells us how to partition the loops. static PHINode *FindPHIToPartitionLoops(Loop *L) { - for (BasicBlock::iterator I = L->getHeader()->begin(); - PHINode *PN = dyn_cast<PHINode>(I); ) { + for (BasicBlock::iterator I = L->getHeader()->begin(); isa<PHINode>(I); ) { + PHINode *PN = cast<PHINode>(I); ++I; if (Value *V = hasConstantValue(PN)) { // This is a degenerate PHI already, don't modify it! @@ -565,8 +566,8 @@ void LoopSimplify::InsertUniqueBackedgeBlock(Loop *L) { // Now that the block has been inserted into the function, create PHI nodes in // the backedge block which correspond to any PHI nodes in the header block. - for (BasicBlock::iterator I = Header->begin(); - PHINode *PN = dyn_cast<PHINode>(I); ++I) { + for (BasicBlock::iterator I = Header->begin(); isa<PHINode>(I); ++I) { + PHINode *PN = cast<PHINode>(I); PHINode *NewPN = new PHINode(PN->getType(), PN->getName()+".be", BETerminator); NewPN->op_reserve(2*BackedgeBlocks.size()); |