Use eraseFromParent().

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40903 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Devang Patel 2007-08-07 17:45:35 +00:00
parent 3baa3aac1b
commit 8431a1cbcc

View File

@ -238,8 +238,7 @@ bool LoopIndexSplit::processOneIterationLoop(LPPassManager &LPM) {
Instruction *NSplitCond = BinaryOperator::create(Instruction::And, Instruction *NSplitCond = BinaryOperator::create(Instruction::And,
C1, C2, "lisplit", Terminator); C1, C2, "lisplit", Terminator);
SplitCondition->replaceAllUsesWith(NSplitCond); SplitCondition->replaceAllUsesWith(NSplitCond);
SplitCondition->removeFromParent(); SplitCondition->eraseFromParent();
delete SplitCondition;
// As a first step to break this loop, remove Latch to Header edge. // As a first step to break this loop, remove Latch to Header edge.
BasicBlock *LatchSucc = NULL; BasicBlock *LatchSucc = NULL;
@ -263,8 +262,7 @@ bool LoopIndexSplit::processOneIterationLoop(LPPassManager &LPM) {
continue; continue;
I->replaceAllUsesWith(UndefValue::get(I->getType())); I->replaceAllUsesWith(UndefValue::get(I->getType()));
I->removeFromParent(); I->eraseFromParent();
delete I;
} }
LPM.deleteLoopFromQueue(L); LPM.deleteLoopFromQueue(L);