From 2da5c3dda6f5b9c4ec6d55008d33327764364bd4 Mon Sep 17 00:00:00 2001 From: Reid Spencer Date: Wed, 15 Sep 2004 17:06:42 +0000 Subject: Convert code to compile with vc7.1. Patch contributed by Paolo Invernizzi. Thanks Paolo! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@16368 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Transforms/Utils/CodeExtractor.cpp | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) (limited to 'lib/Transforms/Utils/CodeExtractor.cpp') diff --git a/lib/Transforms/Utils/CodeExtractor.cpp b/lib/Transforms/Utils/CodeExtractor.cpp index 5dd03bd9e7..2b7eb0093f 100644 --- a/lib/Transforms/Utils/CodeExtractor.cpp +++ b/lib/Transforms/Utils/CodeExtractor.cpp @@ -166,8 +166,8 @@ void CodeExtractor::severSplitPHINodes(BasicBlock *&Header) { // Okay, everthing within the region is now branching to the right block, we // just have to update the PHI nodes now, inserting PHI nodes into NewBB. - for (AfterPHIs = OldPred->begin(); - PHINode *PN = dyn_cast(AfterPHIs); ++AfterPHIs) { + for (AfterPHIs = OldPred->begin(); isa(AfterPHIs); ++AfterPHIs) { + PHINode *PN = cast(AfterPHIs); // Create a new PHI node in the new region, which has an incoming value // from OldPred of PN. PHINode *NewPN = new PHINode(PN->getType(), PN->getName()+".ce", @@ -644,20 +644,21 @@ ExtractCodeRegion(const std::vector &code) { // Loop over all of the PHI nodes in the header block, and change any // references to the old incoming edge to be the new incoming edge. - for (BasicBlock::iterator I = header->begin(); - PHINode *PN = dyn_cast(I); ++I) + for (BasicBlock::iterator I = header->begin(); isa(I); ++I) { + PHINode *PN = cast(I); for (unsigned i = 0, e = PN->getNumIncomingValues(); i != e; ++i) if (!BlocksToExtract.count(PN->getIncomingBlock(i))) PN->setIncomingBlock(i, newFuncRoot); - + } + // Look at all successors of the codeReplacer block. If any of these blocks // had PHI nodes in them, we need to update the "from" block to be the code // replacer, not the original block in the extracted region. std::vector Succs(succ_begin(codeReplacer), succ_end(codeReplacer)); for (unsigned i = 0, e = Succs.size(); i != e; ++i) - for (BasicBlock::iterator I = Succs[i]->begin(); - PHINode *PN = dyn_cast(I); ++I) { + for (BasicBlock::iterator I = Succs[i]->begin(); isa(I); ++I) { + PHINode *PN = cast(I); std::set ProcessedPreds; for (unsigned i = 0, e = PN->getNumIncomingValues(); i != e; ++i) if (BlocksToExtract.count(PN->getIncomingBlock(i))) -- cgit v1.2.3