minor cleanup
authorChris Lattner <sabre@nondot.org>
Fri, 2 Mar 2007 19:59:19 +0000 (19:59 +0000)
committerChris Lattner <sabre@nondot.org>
Fri, 2 Mar 2007 19:59:19 +0000 (19:59 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34846 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Transforms/Scalar/InstructionCombining.cpp

index 7d57022d0fbe23cf044de0e8788eb5424409053a..54eb91f185d2a021059b85fa86e8fd64e75018c8 100644 (file)
@@ -5799,13 +5799,9 @@ Instruction *InstCombiner::PromoteCastOfAllocation(CastInst &CI,
       while (UI != E && *UI == User)
         ++UI; // If this instruction uses AI more than once, don't break UI.
       
-      // Add operands to the worklist.
-      AddUsesToWorkList(*User);
       ++NumDeadInst;
       DOUT << "IC: DCE: " << *User;
-      
-      User->eraseFromParent();
-      removeFromWorkList(User);
+      EraseInstFromFunction(*User);
     }
   }
   
@@ -7389,7 +7385,7 @@ bool InstCombiner::transformConstExprCastCall(CallSite CS) {
 
   if (Caller->getType() != Type::VoidTy && !Caller->use_empty())
     Caller->replaceAllUsesWith(NV);
-  Caller->getParent()->getInstList().erase(Caller);
+  Caller->eraseFromParent();
   removeFromWorkList(Caller);
   return true;
 }