Cleanup
authorChris Lattner <sabre@nondot.org>
Wed, 15 Oct 2003 16:42:21 +0000 (16:42 +0000)
committerChris Lattner <sabre@nondot.org>
Wed, 15 Oct 2003 16:42:21 +0000 (16:42 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9133 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Transforms/Utils/DemoteRegToStack.cpp

index 044cd1610aa3f1c8bdd4da1b551a1053445098f4..18266fb4ce3f7f1203aaade1e8bdde960d04a3e5 100644 (file)
@@ -122,11 +122,8 @@ static void AddLoadsAndStores(AllocaInst* XSlot, Instruction& X,
 }
 
 static void DeletePhis(PhiSet& phisToGo) {
-  for (PhiSetIterator PI=phisToGo.begin(), PE=phisToGo.end(); PI != PE; ++PI) {
-    assert((*PI)->use_size() == 0 && "This PHI should be DEAD!");
-    (*PI)->getParent()->getInstList().remove(*PI);
-    delete *PI;
-  }
+  for (PhiSetIterator PI = phisToGo.begin(), PE =phisToGo.end(); PI != PE; ++PI)
+    (*PI)->getParent()->getInstList().erase(*PI);
   phisToGo.clear();
 }