Use new method
authorChris Lattner <sabre@nondot.org>
Wed, 17 Sep 2003 05:00:07 +0000 (05:00 +0000)
committerChris Lattner <sabre@nondot.org>
Wed, 17 Sep 2003 05:00:07 +0000 (05:00 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8573 91177308-0d34-0410-b5e6-96231b3b80d8

tools/bugpoint/BugDriver.cpp

index e950cdb18c0b6f1bb292dab611f2f8c71345d263..67f59fd54d77657e98f7a6e47a2d4a094e854441 100644 (file)
@@ -54,13 +54,8 @@ std::string getPassesString(const std::vector<const PassInfo*> &Passes) {
 // blocks, making it external.
 //
 void DeleteFunctionBody(Function *F) {
-  // First, break circular use/def chain references...
-  for (Function::iterator I = F->begin(), E = F->end(); I != E; ++I)
-    I->dropAllReferences();
-
-  // Next, delete all of the basic blocks.
-  F->getBasicBlockList().clear();
-  F->setLinkage(GlobalValue::ExternalLinkage);
+  // delete the body of the function...
+  F->deleteBody();
   assert(F->isExternal() && "This didn't make the function external!");
 }