Use eraseFromParent().
authorDevang Patel <dpatel@apple.com>
Tue, 7 Aug 2007 17:45:35 +0000 (17:45 +0000)
committerDevang Patel <dpatel@apple.com>
Tue, 7 Aug 2007 17:45:35 +0000 (17:45 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40903 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Transforms/Scalar/LoopIndexSplit.cpp

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