mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-08-01 16:26:29 +00:00
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
This commit is contained in:
@@ -404,15 +404,15 @@ PHINode *Loop::getCanonicalInductionVariable() const {
|
||||
return 0;
|
||||
|
||||
// Loop over all of the PHI nodes, looking for a canonical indvar.
|
||||
for (BasicBlock::iterator I = H->begin();
|
||||
PHINode *PN = dyn_cast<PHINode>(I); ++I)
|
||||
for (BasicBlock::iterator I = H->begin(); isa<PHINode>(I); ++I) {
|
||||
PHINode *PN = cast<PHINode>(I);
|
||||
if (Instruction *Inc =
|
||||
dyn_cast<Instruction>(PN->getIncomingValueForBlock(Backedge)))
|
||||
if (Inc->getOpcode() == Instruction::Add && Inc->getOperand(0) == PN)
|
||||
if (ConstantInt *CI = dyn_cast<ConstantInt>(Inc->getOperand(1)))
|
||||
if (CI->equalsInt(1))
|
||||
return PN;
|
||||
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user