Change the semancics of the dropallrefs method
authorChris Lattner <sabre@nondot.org>
Wed, 17 Sep 2003 04:58:59 +0000 (04:58 +0000)
committerChris Lattner <sabre@nondot.org>
Wed, 17 Sep 2003 04:58:59 +0000 (04:58 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8572 91177308-0d34-0410-b5e6-96231b3b80d8

lib/VMCore/Function.cpp

index 74098ffc45ae1266e274a7bd2e5619b2980801d1..836c6b64a3353d4f8ffa8dc8fa67b736fba12c9f 100644 (file)
@@ -104,8 +104,6 @@ Function::Function(const FunctionType *Ty, LinkageTypes Linkage,
 Function::~Function() {
   dropAllReferences();    // After this it is safe to delete instructions.
 
-  BasicBlocks.clear();    // Delete all basic blocks...
-
   // Delete all of the method arguments and unlink from symbol table...
   ArgumentList.clear();
   ArgumentList.setParent(0);
@@ -149,6 +147,7 @@ const Type *Function::getReturnType() const {
 void Function::dropAllReferences() {
   for (iterator I = begin(), E = end(); I != E; ++I)
     I->dropAllReferences();
+  BasicBlocks.clear();    // Delete all basic blocks...
 }
 
 /// getIntrinsicID - This method returns the ID number of the specified