mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-12-15 20:29:48 +00:00
Fix bug: IndVarsSimplify/2003-12-10-RemoveInstrCrash.llx
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10385 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
da7d0693b5
commit
88369d214f
@ -140,6 +140,8 @@ static bool TransformLoop(LoopInfo *Loops, Loop *Loop) {
|
||||
|
||||
DEBUG(IV->print(std::cerr));
|
||||
|
||||
while (isa<PHINode>(AfterPHIIt)) ++AfterPHIIt;
|
||||
|
||||
// Don't do math with pointers...
|
||||
const Type *IVTy = IV->Phi->getType();
|
||||
if (isa<PointerType>(IVTy)) IVTy = Type::ULongTy;
|
||||
@ -204,6 +206,9 @@ static bool TransformLoop(LoopInfo *Loops, Loop *Loop) {
|
||||
PHIOps.insert(PHIOps.end(), MaybeDead->op_begin(),
|
||||
MaybeDead->op_end());
|
||||
MaybeDead->getParent()->getInstList().erase(MaybeDead);
|
||||
|
||||
// Erasing the instruction could invalidate the AfterPHI iterator!
|
||||
AfterPHIIt = Header->begin();
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user