Make sure to _delete_ memory allocated by worklists
authorChris Lattner <sabre@nondot.org>
Mon, 4 Nov 2002 02:54:22 +0000 (02:54 +0000)
committerChris Lattner <sabre@nondot.org>
Mon, 4 Nov 2002 02:54:22 +0000 (02:54 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4523 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Transforms/Scalar/SCCP.cpp

index 293469758ad1dd126bf9fe4243d255a73477707a..66818bc3b63bbbe2c7fbfcc009ac44aba250b170 100644 (file)
@@ -314,6 +314,8 @@ bool SCCP::runOnFunction(Function &F) {
   // Reset state so that the next invocation will have empty data structures
   BBExecutable.clear();
   ValueState.clear();
+  std::vector<Instruction*>().swap(InstWorkList);
+  std::vector<BasicBlock*>().swap(BBWorkList);
 
   return MadeChanges;
 }